技巧挺强的。

CODE:

 

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;

#define MAXN 51

int cmp(string a, string b)
{
    if(a+b > b+a) return 1;
        return 0;
//string已经重载了 < > = 运算符 

string str[MAXN];

int main()
{
    int n;
    while(scanf("%d", &n) && n)
    {
        for(int i = 0; i < n; i++)
            cin>>str[i];
        
        for(int i = 0; i < n; i++)
            cout<<str[i];
        cout<<endl;
    }
    return 0;
}

 

posted on 2012-10-14 18:49  有间博客  阅读(116)  评论(0编辑  收藏  举报