#22535: C++ ans(入門級解法)


iamaceoyes@gmail.com (邱義茗)

學校 : 苗栗私立建臺高級中學
編號 : 124247
來源 : [125.231.64.240]
最後登入時間 :
2020-10-23 20:47:35
e286. 籃球比賽 -- APCS | From: [114.41.176.64] | 發表日期 : 2020-09-13 11:51

#include <iostream>

using namespace std;

 

int main(){

int a,b,c,d,e,f,g,h;

int i,j,k,l,m,n,o,p;

int sum1,sum2,sum3,sum4;

 

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

cout << "\n";

cin >> e >> f  >> g >> h;

cout << "\n";

cin >> i >> j  >> k >> l;

cout << "\n";

cin >> m >> n  >> o >> p;

cout << "\n";

 

sum1 = a + b + c + d;

sum2 = e + f + g + h;

sum3 = i + j + k + l;

sum4 = m + n + o + p;

 

cout << sum1 << ":" << sum2 << endl;

cout << sum3 << ":" << sum4 << endl;

 

if(sum1 > sum2 && sum3 > sum4){

cout << "Win";}

else if(sum2 > sum1 && sum4 > sum3){

cout << "Lose";}

else{

cout << "Tie";}

}

 
ZeroJudge Forum