Created
October 11, 2012 19:43
-
-
Save palcu/3875013 to your computer and use it in GitHub Desktop.
Problema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <iostream> | |
#include <algorithm> | |
#include <cstring> | |
using namespace std; | |
bool compara(const char x,const char y) | |
{ | |
return (strcmp(&x,&y)<1); | |
} | |
int main() | |
{ | |
char v[50001][11]; | |
int i,j,k,n; | |
cin>>k; | |
for (i=0; i<k; i++) { | |
cin>>n; | |
for (j=0; j<n; j++) { | |
cin.get(); | |
cin.get(v[j], sizeof(v[j])); | |
} | |
sort(v[i],v[i]+n,compara); | |
for (j=0; j<n; j++) | |
cout<<v[j]<<'\n'; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment