感觉while不是这么写的,附上我写的程序,vc++6.0编译通过:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string word;
while(word != "0")
{
cout<<"Please input your word:";
cin>>word;
cout<<"word read is:"<<word<<endl;
}
cout<<"ok: no more words to read: bye!\n";
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main()
{
string word;
while(word != "0")
{
cout<<"Please input your word:";
cin>>word;
cout<<"word read is:"<<word<<endl;
}
cout<<"ok: no more words to read: bye!\n";
return 0;
}
流光穆然去,美梦随佳人。薄雾似成雨,芳樽清茶冷。郁郁清风外,悠然不复生。