Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- capacity = float(input())
- num_baggage = 0
- free_volume = 0
- input_line = input()
- while input_line != "End":
- volume_per_baggage = float(input_line)
- if volume_per_baggage % 3 == 0:
- volume_per_baggage = volume_per_baggage * 0.1
- free_volume = capacity - volume_per_baggage
- num_baggage += 1
- if volume_per_baggage > free_volume:
- break
- input_line = input()
- if volume_per_baggage > free_volume:
- print("No more space!")
- if input_line == "End":
- print("Congratulations! All suitcases are loaded!")
- print(f"Statistic: {num_baggage} suitcases loaded.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement