Advertisement
bl00dt3ars

01. Counter Strike (Ivcho Stankov)

Jul 1st, 2021
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. initial_energy = int(input())
  2. command = input()
  3. wins = 0
  4.  
  5. while not command == 'End of battle':
  6.     distance = int(command)
  7.     if distance > initial_energy:
  8.         print(f'Not enough energy! Game ends with {wins} won battles and {initial_energy} energy')
  9.         exit()
  10.     wins += 1
  11.     initial_energy -= distance
  12.     if wins % 3 == 0:
  13.         initial_energy += wins
  14.     command = input()
  15.  
  16. print(f'Won battles: {wins}. Energy left: {initial_energy}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement