#30388: c++為什麼這樣不行???


wxmephistoxfaust@gmail.com (舟梅浮永不逆)

學校 : 不指定學校
編號 : 192215
來源 : [203.64.161.123]
最後登入時間 :
2022-05-18 14:21:40
a005. Eva 的回家作業 -- POJ | From: [42.74.250.134] | 發表日期 : 2022-05-18 14:14

#include <iostream>



using namespace std;



int main() {



    int a, b, c, d, e = 0, t,i;



    cin >> t;



    for (i=0;i<t;i++)



        cin >> a >> b >> c >> d;



        if (b - a == c - b) {



            e = d + d - c;



        }



        else{



            e = d * (d / c);



        }

        cout << a << " " << b << " " << c << " " << d << " " << e << endl;



    



}

 
#30416: Re: c++為什麼這樣不行???


cges30901 (cges30901)

學校 : 不指定學校
編號 : 30877
來源 : [39.9.74.255]
最後登入時間 :
2024-10-14 22:20:08
a005. Eva 的回家作業 -- POJ | From: [59.115.17.102] | 發表日期 : 2022-05-20 11:50

#include



using namespace std;



int main() {



    int a, b, c, d, e = 0, t,i;



    cin >> t;



    for (i=0;i



        cin >> a >> b >> c >> d;



        if (b - a == c - b) {



            e = d + d - c;



        }



        else{



            e = d * (d / c);



        }

        cout << a << " " << b << " " << c << " " << d << " " << e << endl;



    



}


for迴圈少了大括號

 
ZeroJudge Forum