View Code of Problem 58

#include <stdio.h>

int main()
{
	char tr[1001]={0};
	int i,k=0;
	gets(tr);
	for(i = 0; tr[i] != 0; ++i)
		if(tr[i] == ' ' && tr[i+1] != ' ')
			++k;
	printf("%d",k);
	return 0;
}

Double click to view unformatted code.


Back to problem 58