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.

24 lines
405 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
// 数位递增数
bool dzs(string s) {
for (int i = 0; i < s.size() - 1; i++)
if (s[i] > s[i + 1]) return false;
return true;
}
/*
25
13
*/
int main() {
int n;
cin >> n;
int cnt = 0;
for (int i = 11; i <= n; i++)
if (dzs(to_string(i))) cnt++;
printf("%d\n", cnt);
return 0;
}