Why I can't take inputs of a string using gets,getline and cin.getline.when I debugg it seems that compiler skips those lines.here's my code-
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s1,s2;
char *p;
int n,m,i;
cin>>n;
for(i=1;i<=n;i++)
{
int j=0;
getline (cin,s1);
getline (cin,s2);
cout<<s1<<"\n";
while(s1[j]!='\0')
{
if(s1[j]==' ')
{
s1.erase(s1[j]);
}
j++;
}
}
cout<<s1<<S2<<endl;
return 0;
}