Advertisement
Spocoman

01. Counter-Strike

Nov 8th, 2023
971
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. energy = int(input())
  2. count = 0
  3.  
  4. command = input()
  5.  
  6. while command != "End of battle":
  7.     index = int(command)
  8.     if energy < index:
  9.         break
  10.     count += 1
  11.     if count % 3 == 0:
  12.         energy += count
  13.     energy -= index
  14.     command = input()
  15.  
  16. if command == "End of battle":
  17.     print(f"Won battles: {count}. Energy left: {energy}")
  18. else:
  19.     print(f"Not enough energy! Game ends with {count} won battles and {energy} energy")
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement