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