Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- targets = list(map(int, input().split()))
- def shoot_target(index):
- if 0 <= index < len(targets) and targets[index] != -1:
- shot_value = targets[index]
- targets[index] = -1
- for i in range(len(targets)):
- if targets[i] > shot_value:
- targets[i] -= shot_value
- elif targets[i] != -1:
- targets[i] += shot_value
- while True:
- command = input()
- if command == "End":
- break
- index = int(command)
- shoot_target(index)
- shot_targets = [target for target in targets if target == -1]
- print(f"Shot targets: {len(shot_targets)} -> {' '.join(map(str, targets))}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement