Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41075 | Hyma | 数位递增数 | C++ | Accepted | 1 MS | 260 KB | 291 | 2024-02-19 09:58:28 |
#include<bits/stdc++.h> using namespace std; int n,cnt; bool check(int x){ int now=1e5,pre=0; while(x>0){ pre=now; now=x%10; if(pre<now)return false; x/=10; } return true; } int main(){ cin>>n; for(int i=11;i<=n;i++)if(check(i))cnt++; cout<<cnt; return 0; }