daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int a, s = 0;
  7.     cin >> a;
  8.    
  9.     int b = 10000000;
  10.    
  11.     for (int i = 7; i > -1; i--, b /= 10) {
  12.         int x = a / b;
  13.         s += x << i;
  14.         a -= b * x;
  15.     }
  16.  
  17.     cout << s;
  18.    
  19.     system("PAUSE");
  20.     return 0;
  21. }
RAW Paste Data
Top