CCC '19 J1 - Winning Score
View as PDFCanadian Computing Competition: 2019 Stage 1, Junior #1
You record all of the scoring activity at a basketball game. Points are scored by a -point shot, a
-point field goal, or a
-point free throw.
You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in a tie.
Input Specification
The first three lines of input describe the scoring of the Apples, and the next three lines of input describe the scoring of the Bananas. For each team, the first line contains the number of successful -point shots, the second line contains the number of successful
-point field goals, and the third line contains the number of successful
-point free throws. Each number will be an integer between
and
, inclusive.
Output Specification
The output will be a single character. If the Apples scored more points than the Bananas, output A. If the Bananas scored more points than the Apples, output B. Otherwise, output T, to indicate a tie.
Sample Input 1
10
3
7
8
9
6
Sample Output 1
B
Explanation for Sample Output 1
The Apples scored points and the Bananas scored
points, and thus the Bananas won.
Sample Input 2
7
3
0
6
4
1
Sample Output 2
T
Explanation for Sample Output 2
The Apples scored points and the Bananas scored
points, and thus it was a tie game.
Comments
FULL MARK CODE
apple_threes = int(input())
apple_twos = int(input())
apple_ones = int(input())
banana_threes = int(input())
banana_twos = int(input())
banana_ones = int(input())
apples_total = (apple_threes (REPLACE WITH TIME SYMBOL) 3) + (apple_twos (REPLACE WITH TIME SYMBOL) 2) + apple_ones
banana_total = (banana_threes (REPLACE WITH TIME SYMBOL) 3) + (banana_twos (REPLACE WITH TIME SYMBOL) 2) + banana_ones
if apples_total > banana_total: print('A')
elif banana_total > apples_total: print('B')
elif apples_total==banana_total: print('T')
wsg gng
initiating input variables
apple_threes = int (input()) apple_twos = int (input()) apple_ones = int (input()) banana_threes = int (input()) banana_twos = int (input()) banana_ones = int (input())
calculating total points
apples_total = apples_threes 3 + apples_twos 2 + apples_ones banana_total = banana_threes 3 + banana_twos 2 + bananas_ones
who wins
if apple_total > banana_total: print('A') elif banana_total > apples_total: print('B') elif apple_total==banana_total: print('T')
initiating input variables
apple_threes = int (input()) apple_twos = int (input()) apple_ones = int (input())
banana_threes = int (input()) banana_twos = int (input()) banana_ones = int (input())
calculating total points
apples_total = apples_threes 3 + apples_twos 2 + apples_ones bananas_total = banana_three 3 + banana_twos 2 + banana_ones
who wins?
if apples_total > banana_total: print('A') elif banana_total > apple_total: print('B') elif apple_total == banana_total: print ('T')
EpicChadGamer is my goat
HMM I WONDER... are we in the grocery market watching living fruits play basketball? if so why?
epic Chad gamer is my goat
what does this mean
yoooo it is epic chadgamer
epic Chad gamer is my goat
orz EpicChadGamer
hi bombaridini tortini
ORZ EpicChadGamer
took me 5 mins to realize the output had to be capital
pay attention to that math. I accidentally kept multiplying everything by '3'. First input worked, second didn't. d'oh. ⇢😅
Just a hint for those who come across this comment:
That's all I can say! Good-luck!
Thank you!
wait it says:::::::::You record all of the scoring activity at a basketball game. Points are scored by a 3-point shot, a 2-point field goal, or a 1-point free throw.
You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in a tie.::::::::::::::::::::::::::::::::::::::::::::::::::::; should'nt it be:::::::::::::::::::::::::::You record all of the scoring activity at a basketball game. Points are scored by a 3-point shot, a 2-point field goal, or a 1-point free throw.
You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in an overtime.:::::::::::::::::::::::::::: crashroyaleoo said that (Thank You crashroyaleoo)(s)he said:::::::::::"basketball games can't end in a tie. the just go to overtime(OT)"::::::::::::::::::::::which meant to be "basketball games can't end in a tie. the GAME WILL just go to overtime(OT)"(Thank You crashroyaleoo again)please press the /\ logo near crashroyaleoo logo to thank me................,......... peace out (^o^)/
fax bro
basketball games can't end in a tie. the just go to overtime(OT)
anything is possible in a word problem.
bob has 45 tomatoes