Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int num;
- cin >> num;
- int x1 = num / 1 % 10;
- int x2 = num / 10 % 10;
- int x3 = num / 100 % 10;
- int x4 = num / 1000 % 10;
- cout << x1 * 1000 + x2 * 100 + x3 * 10 + x4 * 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement