#include <iostream>
#include <cstdlib>
#include <cctype>
using namespace std;
int main()
{
int digit=0,consonant=0,space=0,vowel=0,i;
char text;
cout<<"Input a line of text terminated with the @ character -> ";
cout<<endl;
for (i=0;i<=256;i++)
{
cin.get(text);
if (text=='@')
{
break;
}
else if (isspace(text))
{
space++;
}
else if (isdigit(text))
{
digit++;
}
else if (text!='a'||'e'||'i'||'o'||'u')
{
consonant++;
}
else if (text=='a'||'e'||'i'||'o'||'u')
{
vowel++;
}
}
cout<<"5a) The number of spaces in the line is ";
cout<<space<<endl;
cout<<"5b) The number of vowels in the line is ";
cout<<vowel<<endl;
cout<<"5c) The number of consonants in the line is ";
cout<<consonant<<endl;
cout<<"5d) The total number of digits in the line is ";
cout<<digit<<endl;
if (text=='a'||text=='e'||text=='i'||text=='o'||text=='u')
vowel++;
else//You don't need to check if text!='a' etc. as it is the result of the previous condition. You may need to check if text is a letter
consonant++;