| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 40794 | 老师 | 最大最小 | C++ | Accepted | 100 | 0 MS | 252 KB | 347 | 2022-06-04 14:58:51 |
#include<bits/stdc++.h> using namespace std; int check(int num,int x){ int t=0; while(num){ t+=num%10; num/=10; } return t==x; } int main(){ int l,d,x,mink=10010,maxk=0; cin>>l>>d>>x; for(int i=l;i<=d;i++){ if(check(i,x)){ mink=min(mink,i); maxk=max(maxk,i); } } cout<<mink<<endl<<maxk; return 0; }