#include
#include
using namespace std;
bool compare(string s,string p){
if(s[0]==p[0] && s.length()!=p.length()){
return s>p;
}
return s<p;
}
int main() {
int n;
cin>>n;
string s[n];
for(int i=0;i<n;i++){
cin>>s[i];
}
sort(s,s+n,compare);
for(int i=0;i<n;i++){
cout<<s[i]<<endl;
}
return 0;
}
where is my code going wrong?