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.
25 lines
439 B
25 lines
439 B
#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;
|
|
}
|