View Code of Problem 58

#include<stdio.h>
int main()
{
	int i,n=1;
	char str[100];
	gets(str);
	for(i=0;str[i]!='\0';i++)
	 {
	 	 if(str[i]==' ')
		 {
		 str[i]='@';
		 }
		if(str[i]=='@'&&((str[i+1]>='a'&&str[i+1]<='z'||str[i+1]>='A'&&str[i+1]<='Z')||str[i+1]=='\0'))
		n++;  
	 }
	printf("%d",n);
}

Double click to view unformatted code.


Back to problem 58