题解
2024-08-26 10:54:45
发布于:北京
7阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main(){
string a,b;
int i=0;
cin>>a>>b;
if(a.size()>b.size()){
cout<<b<<endl;
cout<<a;
}
else if(b.size()>a.size()){
cout<<a<<endl;
cout<<b;
}
else{
while(true){
if(a[i]>b[i]){
cout<<b<<endl;
cout<<a;
break;
}
if(b[i]>a[i]){
cout<<a<<endl;
cout<<b;
break;
}
i++;
}
}
return 0;
}
a
全部评论 1
2024-08-26 来自 北京
0
有帮助,赞一个