알고리즘

[알고리즘] 백준 18409 - 母音を?える (Counting Vowels) (C++)

blueberrysoda 2025. 1. 19. 23:28

[문제 링크] : https://www.acmicpc.net/problem/18409

#include <iostream>
using namespace std;

int main(){
    int N, Ans = 0;
    string S;

    cin >> N >> S;

    for(int i=0; i<N; i++){
        if(S[i] == 'a' || S[i] == 'i' || S[i] == 'e' || S[i] == 'o' || S[i] == 'u'){
            Ans++;
        }
    }

    cout << Ans << "\n";
    return 0;
}