웅재의 코딩세상

[프로그래머스] 문자열 곱하기 본문

코딩테스트/프로그래머스 - LV 0

[프로그래머스] 문자열 곱하기

웅드 2024. 1. 22. 17:37

 

 

  • 풀이
#include <string>
#include <vector>

using namespace std;

string solution(string my_string, int k) {
    string answer = "";
    while(k!=0){
        answer += my_string;
        k--;
    }
    return answer;
}
반응형