#include <iostream>
#include <string>
int main()
{
using std::cout;
using std::cin;
using std::getline; //I assume you want spaces in your sentences
using std::string; // can you use std::string? Or only char arrays/chars?
using std::endl;
string setence , vowels = "";
int numVowels = 0;
cout << "Please enter a setence: ";
getline( cin , setence );
for( int i = 0; setence[i]; ++i ) //loop while it is not a null character
{
switch( toupper(setence[i]) )
{
case 'A': case 'E': case 'I': case 'O': case 'U': //some times y?
++numVowels;
vowels += setence[i];
}
}
cout << "Number of vowels: " << numVowels << endl;
cout << "Vowels used are: " << vowels << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKaW50IG1haW4oKQp7CiAgICB1c2luZyBzdGQ6OmNvdXQ7CiAgICB1c2luZyBzdGQ6OmNpbjsKICAgIHVzaW5nIHN0ZDo6Z2V0bGluZTsgLy9JIGFzc3VtZSB5b3Ugd2FudCBzcGFjZXMgaW4geW91ciBzZW50ZW5jZXMKICAgIHVzaW5nIHN0ZDo6c3RyaW5nOyAvLyBjYW4geW91IHVzZSBzdGQ6OnN0cmluZz8gT3Igb25seSBjaGFyIGFycmF5cy9jaGFycz8KICAgIHVzaW5nIHN0ZDo6ZW5kbDsKCiAgICAKICAgIHN0cmluZyBzZXRlbmNlICwgdm93ZWxzID0gIiI7CiAgICBpbnQgbnVtVm93ZWxzID0gMDsKCiAgICBjb3V0IDw8ICJQbGVhc2UgZW50ZXIgYSBzZXRlbmNlOiAiOwogICAgZ2V0bGluZSggY2luICwgc2V0ZW5jZSApOwoKICAgIGZvciggaW50IGkgPSAwOyBzZXRlbmNlW2ldOyArK2kgKSAvL2xvb3Agd2hpbGUgaXQgaXMgbm90IGEgbnVsbCBjaGFyYWN0ZXIKICAgIHsKICAgICAgICBzd2l0Y2goIHRvdXBwZXIoc2V0ZW5jZVtpXSkgKQogICAgICAgIHsKICAgICAgICAgICAgY2FzZSAnQSc6IGNhc2UgJ0UnOiBjYXNlICdJJzogY2FzZSAnTyc6IGNhc2UgJ1Un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