Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4. #include <cstdlib>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10.     freopen("input.txt", "r", stdin);
  11.     freopen("output.txt", "w", stdout);
  12.     string num;
  13.     getline(cin, num);
  14.     unsigned char byte = 0;
  15.     uint64_t res = 0, tmp = 0;
  16.     int cnt = 1;
  17.     for (int i = 0; i < num.size(); ++i) {
  18.         byte = num[i];
  19.         byte ^= ((byte >> 7) << 7);
  20.         tmp = byte;
  21.         res |= (tmp << (7 * i));
  22.  
  23.     }
  24.     cout << res << "\n";
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement