View Code of Problem 58

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{int i;
	char s[100];
	gets(s);
	int count=0;
	for( i=0;i<strlen(s);i++)
	{
		if(s[i]==' '&&s[i+1]!=' ')count++;
	}
	printf("%d",++count);
} 

Double click to view unformatted code.


Back to problem 58