Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int isSorted(int x, int u)
- {
- x /= 10;
- if (x < 100 && x <= u)
- return 1;
- if ((x % 10) > u)
- return 0;
- return isSorted(x, x % 10);
- }
- int main()
- {
- int x;
- cin >> x;
- cout << isSorted(x, x % 10);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement