Not printing s1[0];

#include
#include
#include
using namespace std;
int main() {int i,n;
cin>>n;
string s1[1000];
for(i=0;i<n;i++)
{
getline(cin,s1[i]);
}
sort(s1,s1+n);
for(i=0;i<n;i++)
{
cout<<s1[i]<<endl;
}
}

hi
i think there is some issue in using getline(cin,s) in online ide
just use the simple cin
check this

will report the issue

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.