![]() |
#2
qunxingw2013-10-04 07:04
|
#include<iostream> 这里我想用while循环统计下输入的字符串个数,请问如何退出while循环呢?谢谢。
using namespace std;
int main()
{
string s;
int i=1;
while(cin>>s)
{
cout<<"hello"<<endl;
i++;
}
cout<<i<<endl;
return 0;
}