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