| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 40212 | 杨中琦 | 最大最小 | C++ | Accepted | 100 | 0 MS | 252 KB | 327 | 2022-05-28 14:16:23 |
#include<bits/stdc++.h> using namespace std; int main() { int i,l,d,x,s,ans1,ans2,t=0,a; cin>>l>>d>>x; for(i=l;i<=d;i++) { a=i; s=0; while(true) { s+=a%10; a/=10; if(a==0) break; } if(s==x) { t++; if(t==1) ans1=i; ans2=i; } } cout<<ans1<<endl<<ans2; return 0; }