主题:请各位大虾帮个忙
#include <iostream>
using namespace std;
int main()
{
string word;
while(cin>>word);
cout<<word<<endl;
return 0;
system("pause");
}
请问上面这个程序为什么运行结果为什么只能把两个空格的字符加起来输出.
如我输入
abc def ghi
而结果输出只能是abcdef
而不是abcdefghi
如我想要输出abcdefghi
应如何修改一下呢?
谢谢
using namespace std;
int main()
{
string word;
while(cin>>word);
cout<<word<<endl;
return 0;
system("pause");
}
请问上面这个程序为什么运行结果为什么只能把两个空格的字符加起来输出.
如我输入
abc def ghi
而结果输出只能是abcdef
而不是abcdefghi
如我想要输出abcdefghi
应如何修改一下呢?
谢谢