#28879: help


a0955077720@gmail.com (陳丹尼)

學校 : 不指定學校
編號 : 171273
來源 : [163.13.226.107]
最後登入時間 :
2023-05-03 08:44:50
e286. 籃球比賽 -- APCS | From: [123.192.133.48] | 發表日期 : 2022-01-10 00:03

可以幫我看看錯在哪裡嗎各位大神 

#include <bits/stdc++.h>

using namespace std;

 

int main (void)

{

int a,b,c,d;

int e,f,g,h;

int i,j,k,l;

int m,n,q,r;

int a1,a2,b1,b2;

int point;

 

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

     >> e >> f >> g >> h 

     >> i >> j >> k >> l 

     >> m >> n >> q >> r;

 

a1 = a+b+c+d;

b1 = e+f+g+h;

a2 = i+j+k+l;

b2 = m+n+q+r;

 

(a1>b1)?((a2>b2)?(point=2):(point=0)):((a2>b2)?(point=0):(point=(-2)));

if(point=0){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl;

cout << "Tie";

}else if(point=2){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl; 

cout << "Win";

}else if(point=(-2)){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl;

cout << "Lose";

}

 

return 0;

}

 
#28888: Re:help


cges30901 (cges30901)

學校 : 不指定學校
編號 : 30877
來源 : [39.9.74.255]
最後登入時間 :
2024-10-14 22:20:08
e286. 籃球比賽 -- APCS | From: [39.10.69.93] | 發表日期 : 2022-01-10 12:24

可以幫我看看錯在哪裡嗎各位大神 

#include <bits/stdc++.h>

using namespace std;

 

int main (void)

{

int a,b,c,d;

int e,f,g,h;

int i,j,k,l;

int m,n,q,r;

int a1,a2,b1,b2;

int point;

 

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

     >> e >> f >> g >> h 

     >> i >> j >> k >> l 

     >> m >> n >> q >> r;

 

a1 = a+b+c+d;

b1 = e+f+g+h;

a2 = i+j+k+l;

b2 = m+n+q+r;

 

(a1>b1)?((a2>b2)?(point=2):(point=0)):((a2>b2)?(point=0):(point=(-2)));

if(point=0){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl;

cout << "Tie";

}else if(point=2){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl; 

cout << "Win";

}else if(point=(-2)){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl;

cout << "Lose";

}

 

return 0;

}


if裡面=改成==(兩個等號才是判斷是否相等)

 
#28909: Re:help


a0955077720@gmail.com (陳丹尼)

學校 : 不指定學校
編號 : 171273
來源 : [163.13.226.107]
最後登入時間 :
2023-05-03 08:44:50
e286. 籃球比賽 -- APCS | From: [123.192.133.48] | 發表日期 : 2022-01-11 22:25

可以幫我看看錯在哪裡嗎各位大神 

#include <bits/stdc++.h>

using namespace std;

 

int main (void)

{

int a,b,c,d;

int e,f,g,h;

int i,j,k,l;

int m,n,q,r;

int a1,a2,b1,b2;

int point;

 

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

     >> e >> f >> g >> h 

     >> i >> j >> k >> l 

     >> m >> n >> q >> r;

 

a1 = a+b+c+d;

b1 = e+f+g+h;

a2 = i+j+k+l;

b2 = m+n+q+r;

 

(a1>b1)?((a2>b2)?(point=2):(point=0)):((a2>b2)?(point=0):(point=(-2)));

if(point=0){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl;

cout << "Tie";

}else if(point=2){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl; 

cout << "Win";

}else if(point=(-2)){

cout << a1 << ":" << b1 << endl;

cout << a2 << ":" << b2 << endl;

cout << "Lose";

}

 

return 0;

}


if裡面=改成==(兩個等號才是判斷是否相等)

阿對齁 突然給他忘記 謝謝你的回答~

 
ZeroJudge Forum