32 lines
445 B
C++
32 lines
445 B
C++
#include <cstring>
|
|
#include <iostream>
|
|
using namespace std;
|
|
int main(){
|
|
char a[21][11];
|
|
char sum[220]="";
|
|
int n;
|
|
cin>>n;
|
|
|
|
for(int i=0;i<n;i++){
|
|
cin>>a[i];
|
|
}
|
|
int js=1;
|
|
char tmp[11]="";
|
|
while(js!=0){
|
|
js=0;
|
|
for(int i=0;i<n-1;i++){
|
|
if(strcmp(a[i],a[i+1])<0){
|
|
strcpy(tmp,a[i+1]);
|
|
strcpy(a[i+1],a[i]);
|
|
strcpy(a[i],tmp);
|
|
js++;
|
|
}
|
|
}
|
|
}
|
|
for(int i=0;i<n;i++){
|
|
strcat(sum,a[i]);
|
|
}
|
|
cout<<sum<<endl;
|
|
return 0;
|
|
}
|