View Code of Problem 58

#include <stdio.h>
#include <string.h>
int main(){
	char a[1000]={'\0'};
	int i,tag=0,count=0;
	gets(a);
	for(i=0;i<strlen(a);i++){
		if((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')){
			if(tag==0){
				count++;
				tag=1;
			}
		}
		else{
			tag=0;
		}
	}
	printf("%d",count);
}

Double click to view unformatted code.


Back to problem 58