'commit'
This commit is contained in:
25
TangDou/LanQiaoBei/LanQiao12XuanBaSaiZhongJi/3_2.cpp
Normal file
25
TangDou/LanQiaoBei/LanQiao12XuanBaSaiZhongJi/3_2.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user