标签:scanf str ios cin int stream out iostream string
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int cmp(string a,string b){
return a+b>b+a;
}
int main(){
int n;
while(scanf("%d",&n)==1 && n){
string buf[n];
int i,j;
for(i=0;i<n;i++){
cin>>buf[i];
}
sort(buf,buf+n,cmp);
for(i=0;i<n;i++) {
cout<<buf[i];
}
}
}
标签:scanf str ios cin int stream out iostream string
原文地址:http://www.cnblogs.com/whitehouse2016/p/6532736.html