下面程序的功能是( )。 #include <iostream> #include <string> using namespace std; int main () int i=1, n=0; char s[80],*p; p=s; strcpy(p, It is a book.. ); for (; *p !=’ 0’ ;p++) if(*p==’’) i=0; else if (i==0) n++; i=1; cout<< n= <<n<<end1; return 0;
A.统计字符串中的单词个数
B.统计字符串中的空格个数
C.统计字符串中的字母个数
D.统计字符串中的全部字符个数