Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- easter_bread_count = int(input())
- max_points = -sys.maxsize # най - големите изкарани точки
- best_baker = '' #името на пекаря с най-много точки
- #за всеки един козунак от 1 до последния -> чета името на пекар
- for bread in range(1, easter_bread_count + 1):
- baker_name = input()
- total_points_per_baker = 0
- # четем точки до Stop
- # STOP: command == "Stop" -> command != "Stop"
- command = input() # точки или Stop
- while command != "Stop":
- # точки -> command = "12" -> int
- points = int(command)
- total_points_per_baker += points
- command = input()
- else: #command == "Stop"
- print(f"{baker_name} has {total_points_per_baker} points.")
- # проверка дали неговите точки са максималните
- if total_points_per_baker > max_points:
- max_points = total_points_per_baker
- best_baker = baker_name
- print(f'{best_baker} is the new number 1!')
- print(f'{best_baker} won competition with {max_points} points!')
Advertisement
Add Comment
Please, Sign In to add comment