What is wrong in the program

#include
#include
#include
using namespace std;

bool compare(string a ,string b)
{
if(check_substring(a,b))
{
return a.length()>b.length();
}
return a<b;
}

int main ()
{
int n;
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]<<endl;
}

return 0;

}

pls check i have provided the link to the code

Use cin instead of getline then try

got my mistake …