#includeusing namespace std;int main(){ int ct = 0; for(int i = 99; i <= 100000; i++){ int a[8], len = 0; int j = i; while(j){ a[len++] = j % 10; j /= 10; } int k, jian = 0, zeng = 0; for(k = 1; k < len; k++){ if(a[k] < a[k - 1]){ jian = 1; if(zeng) //上升后又下降,就不合题意 break; } else if(a[k] > a[k - 1] && jian){ zeng = 1; } else break; } if(k >= len && zeng) //并且有增有降 ct++; } cout << ct << endl; return 0;}