1. 문제
https://level.goorm.io/exam/49053/%EC%95%B5%EB%AC%B4%EC%83%88-%EA%BC%AC%EA%BC%AC/quiz/1
구름LEVEL
코딩테스트에서 가장 높은 비중을 차지하는 알고리즘 문제를 제작하고 풀이할 수 있는 온라인 저지 서비스입니다. 기업에서 선호하는 C, C++, 파이썬(Python), 자바(Java), 자바스크립트(Javascript) 이��
level.goorm.io
2. 소스코드
#include <iostream>
#include <string>
#define MAX 5
using namespace std;
char LUT[MAX] = {'a','e','i','o','u'};
int n;
string str;
int main() {
cin >> n;
getline(cin, str);
while (n--){
getline(cin, str);
string ans = "";
for(char ch : str){
char temp_ch = tolower(ch);
if(temp_ch == 'a' or temp_ch == 'e' or temp_ch == 'i' or temp_ch == 'o' or temp_ch == 'u'){
ans += ch;
}
}
if(ans.length() == 0) cout << "???" <<'\n';
else cout << ans << '\n';
}
return 0;
}
'알고리즘 > 구름' 카테고리의 다른 글
[ 구름 / 문자열 ] 회문 풀이 (0) | 2020.06.29 |
---|---|
[ 구름 / 단순 구현 ] 막대기 풀이 (0) | 2020.06.29 |
[ 구름 / 단순 구현 ] 고장난 컴퓨터 풀이 (0) | 2020.06.27 |
[ 구름 / 수학 ] 태민이의 취미 풀이 (0) | 2020.06.27 |
[ 구름 / 단순구현 ] 뱀이 지나간 자리 풀이 (0) | 2020.06.27 |