프로그래머스 181901 배열 만들기 1

1 개요[ | ]

프로그래머스 181901 배열 만들기 1

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

vector<int> solution(int n, int k) {
    vector<int> answer;
    for(int i=1; i<=n; i++) {
        if(i%k==0) answer.push_back(i);
    }
    return answer;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}