i am unable to find my mistake,this program is running fine in my compiler,but here not:
using namespace std;
#include
#include<bits/stdc++.h>
bool compare(string x,string y)
{
string xy=x.append(y);
string yx=y.append(x);
return xy.compare(yx)>0?true:false;
}
int main()
{
int t;
cin>>t;
while(t–)
{
int n,v1=0,v2=0;
cin>>n;
string s[n];
cin.get();
for(int i=0;i<n;i++)
{
getline(cin,s[i]);
}
sort(s,s+n,compare);
for(int i=0;i<n;i++)
cout<<s[i];
cout<<endl;
}
}