본문 바로가기
C++

[프로그래머스] 문자 반복 출력하기

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

#include <string>
#include <vector>

using namespace std;

string solution(string my_string, int n) {
    string answer = "";
    
    for(auto s : my_string)
        for(int i=0;i<n;i++)
            answer.push_back(s);
    
    return answer;
}

728x90
반응형
LIST

댓글