x만큼 간격이 있는 n개의 숫자

magicdrill·2024년 3월 1일
0

x만큼 간격이 있는 n개의 숫자

#include <string>
#include <vector>

using namespace std;

vector<long long> solution(int x, int n) 
{
    vector<long long> answer;
    long long temp = x;
    int i;
    
    for(i = 0; i < n; i++)
    {
        answer.push_back(temp);
        temp += x;
    }
    
    return answer;
}

0개의 댓글