#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<"下面是测试您输入的句子个数"<<endl;
int count=0;
char ch;
while (cin.getline(ch))
{
if (ch=="."||ch=="!"||ch=="?")
count++;
}
cout<<"你输入的句子个数是:"<<count<<endl;
return 0;
}
--------------------Configuration: getline - Win32 Debug--------------------
Compiling...
getline.cpp
E:\vc++\add\getline\getline.cpp(10) : error C2661: 'getline' : no overloaded function takes 1 parameters
E:\vc++\add\getline\getline.cpp(10) : fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.
getline.exe - 1 error(s), 0 warning(s)