Answer 2
This commit is contained in:
28
02/b.py
28
02/b.py
@@ -3,6 +3,8 @@ import os
|
||||
f = open(os.path.dirname(__file__)+"/input.txt", "r")
|
||||
|
||||
tot = 0
|
||||
tot2 = 0
|
||||
|
||||
for l in f:
|
||||
l.strip()
|
||||
choices = l.split(" ")
|
||||
@@ -11,21 +13,46 @@ for l in f:
|
||||
o = choices[1].strip()
|
||||
|
||||
round = 0
|
||||
round2 = 0
|
||||
|
||||
if v == 'A':
|
||||
if o == 'X':
|
||||
round2 = 3
|
||||
if o == 'Y':
|
||||
result = 'win'
|
||||
round2 = 1
|
||||
if o == 'Z':
|
||||
result = 'loss'
|
||||
round2=2
|
||||
|
||||
if v == 'B':
|
||||
if o == 'X':
|
||||
result = 'loss'
|
||||
round2 = 1
|
||||
if o == 'Y':
|
||||
round2 = 2
|
||||
if o == 'Z':
|
||||
result = 'win'
|
||||
round2 = 3
|
||||
|
||||
if v == 'C':
|
||||
if o == 'X':
|
||||
result = 'win'
|
||||
round2 = 2
|
||||
if o == 'Y':
|
||||
result = 'loss'
|
||||
round2 = 3
|
||||
if o == 'Z':
|
||||
round2 = 1
|
||||
|
||||
if o == 'X':
|
||||
round2 = round2 + 0
|
||||
if o == 'Y':
|
||||
round2 = round2 + 3
|
||||
if o == 'Z':
|
||||
round2 = round2 + 6
|
||||
|
||||
tot2 = tot2 + round2
|
||||
|
||||
if o == 'X':
|
||||
round = round + 1
|
||||
@@ -43,3 +70,4 @@ for l in f:
|
||||
tot = tot + round + res
|
||||
|
||||
print(tot)
|
||||
print(tot2)
|
||||
|
||||
Reference in New Issue
Block a user