웅재의 코딩세상

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

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

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

웅드 2024. 1. 22. 17:11

 

 

 

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

using namespace std;

int main(void) {
    string str;
    int n;
    cin >> str >> n;
    while(n!=0) {
        cout << str;
        n--;
    }
    return 0;
}
반응형