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.
26 lines
479 B
26 lines
479 B
#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;
|
|
} |