알고리즘 · 코딩
[SWEA 4406] 모음이 보이지 않는 사람
G A
2020. 5. 26. 14:43
문제 링크
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWNcD_66pUEDFAV8
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
C++ 풀이
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main() {
vector<char>vowels = { 'a','e','i','o','u' };
vector<string>words;
int T, check;
cin >> T;
words.resize(T);
for (int i = 0; i < T; i++)
cin >> words[i];
for (int i = 0; i < T; i++) {
cout << "#" << i + 1 << " ";
for (int j = 0; j < words[i].size(); j++) {
for (check = 0; check < 5; check++) {
if (words[i][j] == vowels[check])
break;
}
if (check >= 5)
cout << words[i][j];
}
cout << '\n';
}
return 0;
}
반응형