View Code of Problem 58

#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
int n,i,k=1;
char s[1000];
gets(s);
n=strlen(s);
for(i=0;i<n-1;i++)
{if(s[i]==' '&&isalpha(s[i+1]))
k++;
}
printf("%d",k);
}

Double click to view unformatted code.


Back to problem 58