You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
// 123
|
|
bool dzs(int x) {
|
|
int p = 10;
|
|
while (x) {
|
|
if (x % 10 > p) return false;
|
|
p = x % 10;
|
|
x /= 10;
|
|
}
|
|
return true;
|
|
}
|
|
int n, cnt;
|
|
|
|
int main() {
|
|
cin >> n;
|
|
for (int i = 11; i <= n; i++)
|
|
if (dzs(i)) cnt++;
|
|
|
|
printf("%d\n", cnt);
|
|
return 0;
|
|
} |