Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
40795 | 老师 | 元音字母 | C++ | Wrong Answer | 0 | 0 MS | 248 KB | 387 | 2022-06-04 15:01:29 |
#include<bits/stdc++.h> using namespace std; int l,d,x,a[100],k=0,ans,t,minx=12000,maxx; int main(){ cin>>l>>d>>x; for(int i=l;i<=d;i++){ t=i; while(t){ a[++k]=t%10; t/=10; } for(int j=k;j>=1;j--){ ans+=a[j]; } if(ans==x&&i<minx){ minx=i; } if(ans==x&&i>maxx){ maxx=i; } ans=0; k=0; } cout<<maxx<<endl<<minx; return 0; }