#include <iostream>
using namespace std;
int main()
{
int race1[5];
int race2[5];
int race3[5];
int race4[5];
int a=0;
int b=0;
int c=0;
int d=0;
for (int i=0;i<4;i++)
{
cin>>race1[i];
}
for (int i=0;i<4;i++)
{
cin>>race2[i];
}
for (int i=0;i<4;i++)
{
cin>>race3[i];
}
for (int i=0;i<4;i++)
{
cin>>race4[i];
}
a=race1[0]+race1[1]+race1[2]+race1[3];
b=race2[0]+race2[1]+race2[2]+race2[3];
c=race3[0]+race3[1]+race3[2]+race3[3];
d=race4[0]+race4[1]+race4[2]+race4[3];
cout<<a<<":"<<b<<endl;
cout<<c<<":"<<d<<endl;
if(a>b&&c>d)
{
cout<<"Win";
}
else if(a>b&&c<d)
{
cout<<"Tie";
}
else if(a<b&&c>d)
{
cout<<"Tie";
}
else if(a==b&&c==d)
{
cout<<"Tie";
}
else if(a<b&&c<d)
{
cout<<"Lose";
}
else if(a==b&&c<d)
{
cout<<"Lose";
}
else if(a<b&&c==d)
{
cout<<"Lose";
}
else if(a>b&&c==d)
{
cout<<"Win";
}
else if(a==b&&c>d)
{
cout<<"Win";
}
return 0;
}
#include
using namespace std;
int main()
{
int race1[5];
int race2[5];
int race3[5];
int race4[5];
int a=0;
int b=0;
int c=0;
int d=0;
for (int i=0;i<4;i++)
{
cin>>race1[i];
}
for (int i=0;i<4;i++)
{
cin>>race2[i];
}
for (int i=0;i<4;i++)
{
cin>>race3[i];
}
for (int i=0;i<4;i++)
{
cin>>race4[i];
}
a=race1[0]+race1[1]+race1[2]+race1[3];
b=race2[0]+race2[1]+race2[2]+race2[3];
c=race3[0]+race3[1]+race3[2]+race3[3];
d=race4[0]+race4[1]+race4[2]+race4[3];
cout< cout< if(a>b&&c>d)
{
cout<<"Win";
}
else if(a>b&&c {
cout<<"Tie";
}
else if(ad)
{
cout<<"Tie";
}
else if(a==b&&c==d)
{
cout<<"Tie";
}
else if(a {
cout<<"Lose";
}
else if(a==b&&c {
cout<<"Lose";
}
else if(a {
cout<<"Lose";
}
else if(a>b&&c==d)
{
cout<<"Win";
}
else if(a==b&&c>d)
{
cout<<"Win";
}
return 0;
}
不用這麼麻煩吧??
用for迴圈