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