View Code of Problem 58

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

Double click to view unformatted code.


Back to problem 58