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