Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 05. Trekking Mania
- groups = int(input())
- all_guys = 0
- musala = 0
- monblan = 0
- kilimandjaro = 0
- k_12 = 0
- everest = 0
- for i in range(groups):
- guys_in_group = int(input())
- if guys_in_group <= 5:
- musala += guys_in_group
- elif guys_in_group >= 6 and guys_in_group <= 12:
- monblan += guys_in_group
- elif guys_in_group >= 13 and guys_in_group <= 25:
- kilimandjaro += guys_in_group
- elif guys_in_group >= 26 and guys_in_group <= 40:
- k_12 += guys_in_group
- elif guys_in_group >= 41:
- everest += guys_in_group
- all_guys = monblan + musala + k_12 + kilimandjaro + everest
- procent_musala = (musala / all_guys) * 100
- procent_monblan = (monblan / all_guys) * 100
- procent_kilimandjaro = (kilimandjaro / all_guys) * 100
- procent_k_12 = (k_12 / all_guys) * 100
- procent_everest = (everest / all_guys) * 100
- print(f"{procent_musala:.2f}%")
- print(f"{procent_monblan:.2f}%")
- print(f"{procent_kilimandjaro:.2f}%")
- print(f"{procent_k_12:.2f}%")
- print(f"{procent_everest:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement