Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- int x;
- cin >> x;
- cout << x % 10 << "\n";
- cout << x % 100 - x % 10 << "\n";
- cout << (x % 100 - x % 10) / 10 << "\n";
- // 123 % 100 = 23
- // 23 % 10 = 3
- // 23 - 3 = 20
- // 20 / 10 = 2
- // (x % 100 / 10)
- cout << (x / 10) % 10 << " количество десятков";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment