Advertisement
Merucial

Christmas tournament

Mar 28th, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. dni = int(input())
  2. countWin=0
  3. countLose=0
  4. countGoodDays = 0
  5. countBadDays=0
  6. sybranaSuma=0
  7.  
  8. for i in range(1, dni+1):
  9.     while 1>0:
  10.         sport = input()
  11.         if sport=="Finish":
  12.             break
  13.         rezultat = input()
  14.  
  15.         if rezultat=="win":
  16.             countWin=countWin+1
  17.         elif rezultat=="lose":
  18.             countLose = countLose+1
  19.     if countWin>countLose:
  20.         suma = countWin*20*1.1
  21.         countGoodDays=countGoodDays+1
  22.     else:
  23.         suma = countWin*20
  24.         countBadDays=countBadDays+1
  25.  
  26.     sybranaSuma = sybranaSuma+suma
  27.     suma=0
  28.     countWin=0
  29.     countLose=0
  30. if countGoodDays>countBadDays:
  31.     print(f"You won the tournament! Total raised money: {sybranaSuma*1.2:.2f}")
  32. else:
  33.     print(f"You lost the tournament! Total raised money: {sybranaSuma:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement