标签:pac main std ios return sort php bool blog
http://acm.xidian.edu.cn/problem.php?id=1088
MDZZ,这么简单的cmp被自己搞的那么复杂,WA了无数遍。
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; string s[100005]; int n; bool cmp(string x,string y) { string X = x+y,Y = y+x; return X > Y; } int main() { while(cin >> n) { for(int i = 1;i <= n;i++) cin >> s[i]; sort(s+1,s+1+n,cmp); for(int i = 1;i <= n;i++) cout << s[i]; cout << endl; } return 0; }
标签:pac main std ios return sort php bool blog
原文地址:http://www.cnblogs.com/zhurb/p/5985579.html