#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ string str1,str2,str3; cin>>str1>>str2>>str3; if(str1>str2){ swap(str1,str2); } if(str1>str3){ printf("%s\n%s\n%s",str3.c_str(),str1.c_str(),str2.c_str()); } else{ printf("%s\n",str1.c_str()); if(str2>str3) swap(str2,str3); printf("%s\n%s",str2.c_str(),str3.c_str()); } return 0; } |
Double click to view unformatted code.