fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int t;
  5. cin>>t;
  6. while(t--){
  7. int n;
  8. cin>>n;
  9. vector<string> v;
  10. for(int i=0;i<n;i++){
  11. string s;
  12. cin>>s;
  13. v.push_back(s);
  14. }
  15. sort(v.begin(),v.end());
  16. for(int i=n-1;i>=0;i--){
  17. cout<<v[i];
  18. }
  19. cout<<endl;
  20.  
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 4552KB
stdin
1
4
54 546 5 68
stdout
68546545