#32739: ans


yp11151049@yphs.tp.edu.tw (801-24)

學校 : 臺北市私立延平高級中學
編號 : 197224
來源 : [203.72.178.1]
最後登入時間 :
2024-01-16 09:26:24
b971. 等差數列 -- 板橋高中教學題 | From: [203.72.178.1] | 發表日期 : 2022-11-02 17:33

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a1,an,d;
    while(cin>>a1>>an>>d){
        int s=(an-a1)/d;
        for(int i=0;i<=s;i++) cout<<a1+i*d<<" ";
        cout<<endl;
    }
    return 0;
}
    

 
ZeroJudge Forum