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

26 lines
479 B
C++

#include <bits/stdc++.h>
using namespace std;
//求递增数组 11-10001之间的
bool IsDiZeng(int n) {
int lastGe, ge = 10;
while (n > 0) {
lastGe = ge;
ge = n % 10;
n /= 10;
if (ge > lastGe) return false;
}
return true;
}
int main() {
int count = 0;
for (int i = 12; i <= 10000; i++) {
if (IsDiZeng(i)) {
count++;
}
}
cout << count << endl;
return 0;
}