#11291: 可以幫我看看哪裡出問題嗎


oldpig123 (o)


RT

在自己電腦內運作正常,但放上來就不行了

是 C++

 

 

#include <iostream>
using namespace std;
int main() {
    int a,b,c,d,e;
    while (cin >> a >> b >> c >> d) {
        if ((b - a) == (d - c)) {
            e = b - a;
            cout << a << " " << b << " " << c << " " << d << " " << d + e << endl;
        }
        else {
            e = float(b / a);
            cout << a << " " << b << " " << c << " " << d << " " << d * e << endl;
        }
    }
    return 0;
}

#11295: Re:可以幫我看看哪裡出問題嗎


who_am_I (kruztw)


RT

在自己電腦內運作正常,但放上來就不行了

是 C++

 

 

#include
using namespace std;
int main() {
    int a,b,c,d,e;
    while (cin >> a >> b >> c >> d) {
        if ((b - a) == (d - c)) {
            e = b - a;
            cout << a << " " << b << " " << c << " " << d << " " << d + e << endl;
        }
        else {
            e = float(b / a);
            cout << a << " " << b << " " << c << " " << d << " " << d * e << endl;
        }
    }
    return 0;
}

測資數目呢?

 

int n; // n筆測資

while(cin >> n){

while(n--){

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

.........................正文.....................

}

}