Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- std::string bitshiftright(std::string s) {
- std::string res;
- res = s[0] + s.substr(0, s.size()-1);
- return res;
- }
- int main() {
- std::string s = "101001";
- std::cout << bitshiftright(s) << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement