Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 05. Bus
- travelers = int(input())
- stops = int(input())
- i = 1
- while i <= stops:
- if i % 2 == 0:
- travelers -= int(input())
- travelers += int(input())
- travelers -= 2
- else:
- travelers -= int(input())
- travelers += int(input())
- travelers += 2
- i += 1
- print(f"The final number of passengers is : {travelers}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement