View Code of Problem 58

#include<stdio.h>
int zimu(char c)
{
	if (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z')
		return 1;
	else
		return 0;
}
int main()
{
	char a[100];
	int i=0, j=0;
	gets(a);
	for (i = 0; a[i] != '\0'; i++)
	{
		if (a[i] == ' ' && zimu(a[i + 1]) == 1)
		{
			j++;
		}
	}
	printf("%d\n", j + 1);
	return 0;
}

Double click to view unformatted code.


Back to problem 58