可以幫我看看錯在哪裡嗎各位大神
#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;
}
可以幫我看看錯在哪裡嗎各位大神
#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裡面=改成==(兩個等號才是判斷是否相等)
可以幫我看看錯在哪裡嗎各位大神
#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裡面=改成==(兩個等號才是判斷是否相等)
阿對齁 突然給他忘記 謝謝你的回答~