Files
python/TangDou/ShuLun/SL11.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

25 lines
439 B
C++

#include <bits/stdc++.h>
using namespace std;
int res;
const int N = 110;
int a[N];
//判断是不是数位递增数
bool judge(int x) {
string s = to_string(x);
for (int i = 0; i < s.size() - 1; i++)
if (s[i] > s[i + 1]) return false;
return true;
}
int main() {
int n;
cin >> n;
for (int i = 10; i <= n; i++)
if (judge(i)) res++;
printf("%d", res);
return 0;
}