Advertisement
bl00dt3ars

01. Counter Strike (MarinaD)

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