View Code of Problem 58

#include <stdio.h>
#include <string.h>
int main(){
	char num[200];
	gets(num);
	int words=0;
	int len =strlen(num);
	for(int i=0; i<len; i++)
	{
		if((num[i]!=" ")&&(num[i+1]==" "))
			words++;
	}
	printf("%d",words);
	return 0;
}

Double click to view unformatted code.


Back to problem 58