본문 바로가기

코딩테스트

프로그래머스_0단계_모음 제거 C++

 

문제풀이:

#include <string>
#include <vector>

using namespace std;

string solution(string my_string) {
    string answer = "";
    
    for( char c : my_string)
    {
        if(c == 'a' || c == 'e' || c == 'i'|| c== 'o'|| c== 'u')
            continue;
        else
        {
            answer+= c;
        }
    }
    return answer;
}