View Code of Problem 58

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

Double click to view unformatted code.


Back to problem 58