sdf
2024-08-08 18:07:46
发布于:广东
#include <bits/stdc++.h>
using namespace std;
int main(){
int l,d,x;
int t;
int mn=10001,mx=-1;
cin>>l>>d>>x;
for(int i=l;i<=d;i++){
t=i;
int s=0;
while(t>0){
s+=t%10;
t/=10;
}
if(x==s){
mx=max(mx,i);
mn=min(mn,i);
}
}
cout<<mn<<endl<<mx;
}
全部评论 1
6
2024-08-08 来自 广东
0
有帮助,赞一个