![]() |
#2
luxiaocheng2010-02-01 22:15
|

#include <string>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
string word;
// read until end-of-file, writing each word to a new line
while (cin >> word)
cout << word << endl;
return 0;
}
上面这段程序是C++ Primer上的,为何出现无法编译的错误啊?#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
string word;
// read until end-of-file, writing each word to a new line
while (cin >> word)
cout << word << endl;
return 0;
}