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;
}
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;
.........................正文.....................
}
}