그림 확대1 [프로그래머스][C++] 그림 확대 #include #include using namespace std; vector solution(vector picture, int k) { vector answer; for(int i = 0; i < picture.size(); i++) { string expandStr; for(int j = 0; j < picture[i].size(); j++) { for(int n = 0; n < k; n++) { expandStr += picture[i][j]; } } for(int n = 0; n < k; n++) { answer.push_back(expandStr); } } return answer; } 1. picture의 크기만큼 반복하며 매 반복시 추가될 확장한 문자열 expandStr을 선언한다. 2.. 2023. 10. 26. 이전 1 다음