#include<string>
#include<iostream>
using namespace std;
using std::string;
int main()
{
string line;
while( getline(cin,line) )
cout << line << endl;
return 0;
}
这段代码是不是有bug??结果中不含有press any key to continue!!!
...全文
1077打赏收藏
使用getline读取一整行
#include #include using namespace std; using std::string; int main() { string line; while( getline(cin,line) ) cout << line << endl; return 0; } 这段代码是不是有bug??结果中不含有press any key to continue!!!