Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main () {
- using std::cin;
- int amount = 0;
- cin >> amount;
- auto is_vowel = [](char letter) {
- for (char a : "aieouy")
- if (letter == a) return 1;
- return 0;
- };
- // Cycle-related block
- char ch;
- int number_of_vowels;
- for (int i = 0; i < amount; i++) {
- cin >> ch;
- number_of_vowels = 0;
- while (ch != '\n') {
- number_of_vowels += is_vowel(ch); // is_vowel returns 0/1
- cin.get(ch); // moving cursor right
- }
- cin.get();
- // std::cout << number_of_vowels << " ";
- std::cout << i << " "; // for testing purposes
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement