Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- bus = 0
- truck = 0
- train = 0
- average = 0
- total_tons = 0
- for i in range(n):
- tons = int(input())
- if tons <= 3:
- bus += tons
- elif tons >= 4 and tons <= 11:
- truck += tons
- elif tons >= 12:
- train += tons
- total_tons = bus + truck + train
- average = (bus * 200 + truck * 175 + train * 125) / total_tons
- bus_percent = (bus / total_tons) * 100
- truck_percent = (truck / total_tons) * 100
- train_percent = (train / total_tons) * 100
- print(f'{average:.2f}')
- print(f'{bus_percent:.2f}%')
- print(f'{truck_percent:.2f}%')
- print(f'{train_percent:.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement