View Code of Problem 58

#include<stdio.h> 

int main()
{
	char s[100];
	gets(s);
	int i;
	int count;
	for( i=0; s[i]!='\0'; i++ )
	{
		if (s[i]<='z' && s[i]>='a' && s[i+1]==' ')
		{
			count ++;
		}
	}
	printf("%d", count);
	return 0;
}

Double click to view unformatted code.


Back to problem 58