trr
2024-08-08 19:53:27
发布于:广东
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
int t;
int mn=10001,mx=-1;
cin>>a>>b>>c;
for(int i=a;i<=b;i++){
t=i;
int s=0;
while(t>0){
s+=t%10;
t/=10;
}
if(c==s){
mx=max(mx,i);
mn=min(mn,i);
}
}
cout<<mn<<endl<<mx;
}
这里空空如也
有帮助,赞一个