#include <iostream>
#include <cctype>
#define MAX 40

using namespace std;

int main()
{
	char str[MAX];
	int word= 0;
	
	cout << "Enter a string: " ;
	cin.getline(str,MAX);
	cout << endl;
	
	cout << "List of words:";
	
	for (int i = 0; str[i] != '\0'; i++)
	{
		if((isspace(str[i]))||(str[i]==str[0]))
		{
			cout << endl;
			cout <<"   Word " << ++word <<" >> ";
		}
		
		if (isalpha(str[i]))
		{
		    str[i]=tolower(str[i]);
		    cout << str[i];
		}
	}
	cout << endl << endl;
	cout << "The number of words = " << word;
	return 0;
}
