24 lines
405 B
C++
24 lines
405 B
C++
#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;
|
||
} |