Advertisement
Osiris1002

Counter-Strike

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