Probably because of the dangling new line character left in the buffer by your previous extraction. Try to ignore() the character before you enter the loop.
Just to clarify a bit on what @jlb said. If you first use cin >> and then switch to getline(). You will have to put a cin.ignore(); after the cin >> (becuase of the reasons @jlb stated above). Like this -
1 2 3 4 5
int n;
cout << "input number of strings: ";
cin >> n;
cin.ignore();
string s1[100], s2;