View Code of Problem 58

#include<stdio.h>
#include<math.h>
#include<ctype.h>
#include<string.h>
#include<iostream>
using namespace std;
#include<algorithm>
int main()
{
	char str[100];
	char a[100];
	int flag = 0;
	gets(str);
	int count = 0;
	int len = strlen(str);
	for (int i = 0; i < len; i++)
	{
	
		
		if (i>0&&isspace(str[i-1])&&isalpha(str[i]))
		{
			count++;
		}
	}
	cout << count + 1;

}

Double click to view unformatted code.


Back to problem 58