728x90
모음의 개수를 카운트 한 다음 출력해주었습니다.
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main(int argc, char* argv[])
{
int count = 0;
string s;
cin >> s;
for (int i = 0; i < s.length(); ++i) {
if (s[i] == 'a' || s[i] == 'e' || s[i] == 'o' || s[i] == 'u' || s[i] == 'i') {
++count;
}
}
cout << count << endl;
return 0;
}
'알고리즘' 카테고리의 다른 글
[C++] 백준 2749번 피보나치 수 3 (0) | 2019.09.13 |
---|---|
[C++] 백준 10826번 피보나치 수 4 (0) | 2019.09.12 |
[C++] 백준 2864번 5와 6의 차이 (0) | 2019.09.12 |
[C++] 백준 11656번 접미사 배열 (0) | 2019.09.12 |
[C++] 백준 10988번 팰린드롬인지 확인하기 (0) | 2019.09.12 |