fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. int counter=0;
  7. string text; //инициализируем строку
  8. getline (cin,text); //извлекает строки из входного потока
  9. string vowel="AEOUIY"; //
  10. size_t found=text.find_first_of(vowel); //Поиск по строке text для первого символа, который соответствует любому элементу строки vowel
  11. while (found!=-1)
  12. {
  13. counter++;
  14. found=text.find_first_of(vowel,found+1);
  15. }
  16. cout << counter << endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 3416KB
stdin
COBBRA
stdout
2