Self new textbooks -p294

Source:

#include<iostream>

using namespace std;

int main ()

{

char str[30];

while (! cin.eof ()) // When the input stream does not end the cycle continues

{

Before all characters: // skip stream cin '';: cin.ignore (10, '')

if (! cin.eof ()) // if the input stream is not over

{

cin >> str; // enter the phone number

cout << str << endl;

}

}

system("pause");

return 0;

}

 operation result:

Guess you like

Origin www.cnblogs.com/duanqibo/p/12236110.html