#include<iostream>
#include<string>
using namespace std;
int main()
{
int i=1;
string b;
cout<<"Input:";
while(cin>>b)
cout<<"Output:"<<endl<<i++<<" word is:"<<b<<'\n';
cout<<"ok,Words have been read out!"<<endl;
return 0;
}
The execution results are as follows. One sentence is not executed.
References
【1】C++ primer.