電腦上跑沒問題,可是測時就錯了.
請問是哪邊寫錯了?
第 1 測資點(100%): WA (line:2)
答案不正確
您的答案為: 1 3 5 7 9 正確答案為: 1 2 4 8 16
#include <iostream>
using namespace std;
int main(){
int a;
int b,c,d,e,s;
while(cin>>a>>b>>c>>d>>e){
if((e-d) == (d-c) && (d-c) == (c-b)){
s=0;
s=e+(d-c);
cout<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<s<<endl;
}
else if ((e/d) == (d/c) && (d/c) == (c/b)){
s=0;
s=e*(d/c);
cout<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<s<<endl;
}
}
return 0;
}