본문 바로가기
C++

[프로그래머스] 특정 문자 제거하기

by 띰쥬 2025. 9. 4.
728x90
반응형
SMALL

#include <string>
#include <vector> 
#include <cstring> 

using namespace std;

string solution(string my_string, string letter) {
    string answer = "";
    char target = letter.front();
    
    for(char str:my_string)
        if(str!=target)
            answer+=str;

    return answer;
}

728x90
반응형
LIST

댓글