프로그래머스 181836 그림 확대

Jmnote (토론 | 기여)님의 2023년 10월 19일 (목) 16:22 판 (새 문서: ==개요== {{프로그래머스|레벨=0|페이지=6}} ==C++== <syntaxhighlight lang='cpp'> #include <string> #include <vector> using namespace std; vector<string> solution(vector<...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

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;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}