Computer Science/Coding Test
c++(cpp) 프로그래머스 - 코딩 테스트 : x만큼 간격이 있는 n개의 숫자
hzyiunn
2022. 7. 28. 00:20
728x90
반응형
#include <string>
#include <vector>
using namespace std;
vector<long long> solution(int x, int n) {
vector<long long> answer;
answer.push_back(x);
for(int i = 1; i < n; i++)
{
answer.push_back(x+(x*i));
}
return answer;
}
728x90
반응형