View Code of Problem 58

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

Double click to view unformatted code.


Back to problem 58