프로그래머스 181836 그림 확대

1 개요[ | ]

프로그래머스 181836 그림 확대

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

vector<string> solution(vector<string> picture, int k) {
    vector<string> answer;
    for(const string& el: picture) {
        string row = "";
        for(char ch: el) {
            for(int i=0; i<k; i++) {
                row += ch;
            }
        }
        for(int i=0; i<k; i++) {
            answer.emplace_back(row);
        }
    }
    return answer;
}
#include <string>
#include <vector>

using namespace std;

vector<string> solution(vector<string> picture, int k) {
    vector<string> answer;
    for(const string& el: picture) {
        string row = "";
        for(char ch: el) {
            row += string(k, ch);
        }
        for(int i=0; i<k; i++) {
            answer.emplace_back(row);
        }
    }
    return answer;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}