大家帮忙看看,错在哪里,编译不通过!
#include <iostream>using namespace std;
int main()
{
string s("Hello World!!");
string::size_type punct_cnt=0;
for (string::size_type index=0;index!=s.size();++index)
{
if (ispunct(s[index]))
++punct_cnt;
}
cout <<punct_cnt
<<" punctuation characters in"
<<s
<<endl;
return 0;
}