← Back to List

17009번: Winning Score ↗

Solutions

C++14
290 B | 290 chars
#include <iostream>
using namespace std;
int a,S1,S2;
int main()
{
    for(int x=3; x>=1; x--)
    {
        cin>>a;
        S1+=a*x;
    }
    for(int x=3; x>=1; x--)
    {
        cin>>a;
        S2+=a*x;
    }
    if(S1==S2) cout<<"T";
    else if(S1>S2) cout<<"A";
    else cout<<"B";
}