You are on page 1of 1

#include <iostream>

#include <string.h>

using namespace std;

int main()
{
int space_count = 0, vowel_count = 0, consonne_count = 0;
char s[255] = "";
cin.getline(s, 255);

for(unsigned int i = 0; i < strlen(s); i++)


{
if(s[i] == ' ')
space_count++;
else if(strchr("aeiou", s[i]) != 0)
vowel_count++;
else if(strchr("aeiou", s[i]) == 0)
consonne_count++;
}

cout << "apar " << space_count << " spatii" << endl;
cout << "apar " << vowel_count << " vocale" << endl;
cout << "apar " << consonne_count << " consoane" << endl;

return 0;
}

You might also like