Advertisement
_eremec_

Untitled

Dec 17th, 2017
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. std::string bitshiftright(std::string s) {
  5.     std::string res;
  6.     res = s[0] + s.substr(0, s.size()-1);
  7.     return res;
  8. }
  9.  
  10.  
  11. int main() {
  12.     std::string s = "101001";
  13.     std::cout << bitshiftright(s) << std::endl;
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement