View Code of Problem 58

#include<stdio.h>
int main(){
	char A[50];
	gets(A);
	int flag=0,count=0,i=0;
	while(A[i]!='\0'){
		if(A[i]!=' '){
			flag++;
			if(flag==1)
			count++;
			i++;
		}
		else{
			 flag=0;
			 i++;
		}  
	}
	printf("%d",count);
}

Double click to view unformatted code.


Back to problem 58