Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41075 Songgy_King 数位递增数 C++ 通过 1 MS 260 KB 291 2024-02-19 09:58:28

Tests(1/1):


#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; }


测评信息: