题目描述
输入三个字符串,按由小到大的顺序输出
输入描述
3行字符串
输出描述
按照从小到大输出成3行
样例输入
cde
afg
abc
样例输出
abc
afg
cde
示例代码:
#include <iostream>
#include <string>
using namespace std;
int main(){
string a,b,c,temp;
cin>>a>>b>>c;
if(a < b){
temp = a;
a = b;
b = temp;
}
if(a < c){
temp = a;
a = c;
c = temp;
}
if(c > b){
temp = c;
c = b;
b = temp;
}
cout<<c<<endl;
cout<<b<<endl;
cout<<a<<endl;
return 0;
}