| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 40622 | 张浩然 | 最大最小 | C++ | Accepted | 100 | 0 MS | 248 KB | 316 | 2022-05-29 18:57:10 |
#include<bits/stdc++.h> using namespace std; int l,d,x,imin=10000,imax=-10000; int m=0; int main(){ cin>>l>>d>>x; for(int i=l;i<=d;i++){ int j=i; while(j){ m+=j%10; j/=10; } if(m==x){ imax=max(i,imax); imin=min(i,imin); } m=0; } cout<<imin<<endl<<imax; return 0; }