Wrong output,all test cases are falied

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;
}
}

line 23
cin >> s[i]; getline mt use karo

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.