![]() |
#2
diycai2021-11-30 11:23
|
#include<stdio.h>
int main()
{
char cS[100];
int iI,iW=1;
char cBlank;
gets(cS);
if(cS[0]=='\0')
{
printf("There is no char!\n");
}
else if(cS[0]==' ')
{
printf("First char just is a blank!\n");
}
else
{
for(iI=0;cS[iI]!='\0';iI++) \*第17行*\
{
cBlank=cS[iI];
if(cBlank==' ')
{
iW++;
}
}
printf("%d\n",iW);
}
return 0;
}