Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- energy = int(input())
- distance = input()
- count_wins = 0
- while not distance == "End of battle":
- distance_as_int = int(distance)
- if energy < distance_as_int:
- print(f"Not enough energy! Game ends with {count_wins} won battles and {energy} energy")
- break
- energy = energy - distance_as_int
- count_wins += 1
- if count_wins % 3 == 0:
- energy += count_wins #Увеличаваме енергията с броя на победите на всяка 3та победа! :)
- distance = input()
- if distance == "End of battle":
- print(f"Won battles: {count_wins}. Energy left: {energy}")
Advertisement
RAW Paste Data
Copied
Advertisement