Guest User

Untitled

a guest
Oct 16th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main () {
  6.     int x;
  7.     cin >> x;
  8.     cout << x % 10 << "\n";
  9.     cout << x % 100 - x % 10 << "\n";
  10.     cout << (x % 100 - x % 10) / 10 << "\n";
  11.     // 123 % 100 = 23
  12.     // 23 % 10 = 3
  13.     // 23 - 3 = 20
  14.     // 20 / 10 = 2
  15.     // (x % 100 / 10)
  16.     cout << (x / 10) % 10 << " количество десятков";
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment