#include <iostream>
#include <cctype>
using namespace std;

int main()
{

    const int MAX =40;
	char str[MAX];
    int nwords=0 , nspace=1 , punct=0 ,nletter=0 , digit=0;
    int j;
	cout << "Enter a string: ";
	cin.getline(str, MAX);
	
	cout << endl << "Word " << nspace << ": ";
	for (int i =0; str[i] != '\0'; i++ )
	{
		if(isspace( str[i])) //problem
		{
	 		nspace++;
	 		cout << endl << "Word " << nspace << ": " ;
	 	    
		}
		
		if(isalpha(str[i]))
		{
		
	 		nletter++;
	 		 str[i] = tolower(str[i]);
	 		cout << str[i];
		}
		if(isdigit(str[i]))
    {
    	digit++;
    }
    
		
		if(str[i]== ' ')
		{
	 		nwords++;
	 		cout << str[i] ;
		}
		if(ispunct(str[i]))
		    {
		    	punct++;
		    }

}
	

cout<<"\n The name in lower case is:" << str << endl;
cout << "The number of words: " << nwords+1 << endl;
cout << "Number of punctuation: "<< punct<<endl;
return 0;
}
	
    
