Advertisement
Merucial

Christmas Tour

Mar 28th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. days = int(input())
  2. countWin=0
  3. countLose=0
  4. countGoodDays = 0
  5. countBadDays=0
  6. total_sum=0
  7.  
  8. for i in range(1, days+1):
  9.     while 1 > 0:
  10.         sport = input()
  11.         if sport == "Finish":
  12.             break
  13.         result = input()
  14.  
  15.         if result == "win":
  16.             countWin = countWin+1
  17.         elif result == "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.     total_sum = total_sum+suma
  27.     suma = 0
  28.     countWin = 0
  29.     countLose = 0
  30. if countGoodDays > countBadDays:
  31.     print(f"You won the tournament! Total raised money: {total_sum*1.2:.2f}")
  32. else:
  33.     print(f"You lost the tournament! Total raised money: {total_sum:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement