#20874: 請問我這樣寫哪裡有錯誤QAQ


michellechang958@gmail.com (Michelle Chang)


#include <iostream>

using namespace std;
int main(){
int t;
cin>>t;
for (int i=0;i<t;i++){
int a,b,c,d,e,r;
cin>>a>>b>>c>>d;
if(b-a==c-b){
r=b-a;
e=d+;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
if((b*b==a*c)&&(c*c==b*d)){
r=d/c;
e=d*r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
}
return 0;
}

 

我自己試的時候都ok,但交出去的時候一直100%WA(line:4)

他說我的解答為:1 1 1 1 1

正確答案為:2 4 6 8 10

有誰可以救救我TAT

#20875: Re:請問我這樣寫哪裡有錯誤QAQ


michellechang958@gmail.com (Michelle Chang)


#include

using namespace std;
int main(){
int t;
cin>>t;
for (int i=0;i<t;i++){
int a,b,c,d,e,r;
cin>>a>>b>>c>>d;
if(b-a==c-b){
r=b-a;
e=d+r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
if((b*b==a*c)&&(c*c==b*d)){
r=d/c;
e=d*r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
}
return 0;
}

 

我自己試的時候都ok,但交出去的時候一直100%WA(line:4)

他說我的解答為:1 1 1 1 1

正確答案為:2 4 6 8 10

有誰可以救救我TAT




#20877: Re:請問我這樣寫哪裡有錯誤QAQ


kobe60116@gmail.com (xlonely_cat 孤貓)


#include

using namespace std;
int main(){
int t;
cin>>t;
for (int i=0;i<t;i++){
int a,b,c,d,e,r;
cin>>a>>b>>c>>d;
if(b-a==c-b){
r=b-a;
e=d+r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
if((b*b==a*c)&&(c*c==b*d)){
r=d/c;
e=d*r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
}
return 0;
}

 

我自己試的時候都ok,但交出去的時候一直100%WA(line:4)

他說我的解答為:1 1 1 1 1

正確答案為:2 4 6 8 10

有誰可以救救我TAT






找到bug了

1 2 4 8
2*2=1*4
4*4=2*8
滿足你設的兩個條件
#20878: Re:請問我這樣寫哪裡有錯誤QAQ


kobe60116@gmail.com (xlonely_cat 孤貓)


#include

using namespace std;
int main(){
int t;
cin>>t;
for (int i=0;i<t;i++){
int a,b,c,d,e,r;
cin>>a>>b>>c>>d;
if(b-a==c-b){
r=b-a;
e=d+r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
if((b*b==a*c)&&(c*c==b*d)){
r=d/c;
e=d*r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
}
return 0;
}

 

我自己試的時候都ok,但交出去的時候一直100%WA(line:4)

他說我的解答為:1 1 1 1 1

正確答案為:2 4 6 8 10

有誰可以救救我TAT






找到bug了

2 4 6 8
2*2=1*4
4*4=2*8
滿足你設的兩個條件




#20879: Re:請問我這樣寫哪裡有錯誤QAQ


kobe60116@gmail.com (xlonely_cat 孤貓)


#include

using namespace std;
int main(){
int t;
cin>>t;
for (int i=0;i<t;i++){
int a,b,c,d,e,r;
cin>>a>>b>>c>>d;
if(b-a==c-b){
r=b-a;
e=d+r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
if((b*b==a*c)&&(c*c==b*d)){
r=d/c;
e=d*r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
}
return 0;
}

 

我自己試的時候都ok,但交出去的時候一直100%WA(line:4)

他說我的解答為:1 1 1 1 1

正確答案為:2 4 6 8 10

有誰可以救救我TAT






找到bug了

2 4 6 8
第一條件
4-2 =2
8-6=2
第二條件
2*2=1*4
4*4=2*8
滿足你設的兩個條件
所以有bug







#20880: Re:請問我這樣寫哪裡有錯誤QAQ


kobe60116@gmail.com (xlonely_cat 孤貓)


#include

using namespace std;
int main(){
int t;
cin>>t;
for (int i=0;i<t;i++){
int a,b,c,d,e,r;
cin>>a>>b>>c>>d;
if(b-a==c-b){
r=b-a;
e=d+r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
if((b*b==a*c)&&(c*c==b*d)){
r=d/c;
e=d*r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
}
return 0;
}

 

我自己試的時候都ok,但交出去的時候一直100%WA(line:4)

他說我的解答為:1 1 1 1 1

正確答案為:2 4 6 8 10

有誰可以救救我TAT






找到bug了

2 4 6 8
第一條件
4-2 =2
6-4=2
第二條件
2*2=1*4
4*4=2*8
滿足你設的兩個條件
所以有bug










#20881: Re:請問我這樣寫哪裡有錯誤QAQ


kobe60116@gmail.com (xlonely_cat 孤貓)


#include

using namespace std;
int main(){
int t;
cin>>t;
for (int i=0;i<t;i++){
int a,b,c,d,e,r;
cin>>a>>b>>c>>d;
if(b-a==c-b){
r=b-a;
e=d+r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
if((b*b==a*c)&&(c*c==b*d)){
r=d/c;
e=d*r;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
}
}
return 0;
}

 

我自己試的時候都ok,但交出去的時候一直100%WA(line:4)

他說我的解答為:1 1 1 1 1

正確答案為:2 4 6 8 10

有誰可以救救我TAT






找到bug了

2 4 6 8
第一條件
4-2 =2
6-4=2
第二條件
2*2=1*4
4*4=2*8
滿足你設的兩個條件
所以有bug










就算自己測試對的

但程式還是有問題