Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- # Четене на входните данни
- num_tournaments = int(input())
- starting_points = int(input())
- # Инициализация на променливи
- final_points = starting_points
- won_tournaments = 0
- # Обхождане на всички турнири
- for _ in range(num_tournaments):
- tournament_result = input()
- if tournament_result == "W":
- final_points += 2000
- won_tournaments += 1
- elif tournament_result == "F":
- final_points += 1200
- elif tournament_result == "SF":
- final_points += 720
- # Изчисляване на средните точки и процента на спечелени турнири
- total_points = final_points - starting_points
- average_points = math.floor(total_points / num_tournaments)
- percentage_won = (won_tournaments / num_tournaments) * 100
- # Извеждане на резултатите
- print(f"Final points: {final_points}")
- print(f"Average points: {average_points}")
- print(f"{percentage_won:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement