View Code of Problem 58

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

Double click to view unformatted code.


Back to problem 58