View Code of Problem 58

#include <stdio.h>
#include <stdlib.h>
int main()
{
	int i,word=0,num=0;
	char string[81];
	char c;
	gets(string);
	for(i=0;(c=string[i])!='\0';i++)
	if(c==' ')
		word=0;
	else if(word==0)
	{
		word=1;
		num++; 
	}
	printf("%d",num);
	return 0;
}

Double click to view unformatted code.


Back to problem 58