Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- initial_energy = int(input())
- command = input()
- wins = 0
- while not command == 'End of battle':
- distance = int(command)
- if distance > initial_energy:
- print(f'Not enough energy! Game ends with {wins} won battles and {initial_energy} energy')
- exit()
- wins += 1
- initial_energy -= distance
- if wins % 3 == 0:
- initial_energy += wins
- command = input()
- print(f'Won battles: {wins}. Energy left: {initial_energy}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement