View Code of Problem 58

#include <stdio.h>
int main()
{
	char pre=' ',c;
	int count=0;
	while((c=getchar())!=EOF)
	{
		if((((c>='A')&&(c<='Z')) || ((c>='a')&&(c<='z'))) && pre==' ')
			count++;
		pre=c;
	}
	printf("%d\n",count);
	return 0;
}

Double click to view unformatted code.


Back to problem 58