jeudi 2 avril 2015

To take sentence as a input in c++

I am trying to take the input of the two sentences one after the other,but while printing it is printing a blank space and in the next line it is printing the first sentence and the loop is exiting.


Here is my code:


int main() {



char b[100000];
char c[100000];
int t;
cin>>t;
while(t--)
{
cin.getline(b,100000);
cin.getline(c,100000);
cout<<b<<"\n"<<c<<"\n";
}}


The input:


1


run run


good sentence


The output:


Blankspace


run run


Aucun commentaire:

Enregistrer un commentaire