View Code of Problem 58

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

	return 0;
}

Double click to view unformatted code.


Back to problem 58