Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import ceil
- days = int(input())
- food = float(input())
- food_eaten_total = 0
- biscuits_eaten_total = 0
- food_eaten_dog_total = 0
- food_eaten_cat_total = 0
- # Защо ти е това, вместо да ползваш променливата от цикъла за брой дни ?
- # d = 0
- for day in range(1, days + 1):
- food_eaten_dog = int(input())
- food_eaten_cat = int(input())
- # d += 1
- food_eaten_dog_total += food_eaten_dog
- food_eaten_cat_total += food_eaten_cat
- food_eaten_day = food_eaten_dog + food_eaten_cat
- food_eaten_total += food_eaten_day
- if day % 3 == 0:
- # Нямаш нужда от тази променлива, абсолютно излишно е
- # biscuits_eaten_day = (food_eaten_day * 0.10)
- biscuits_eaten_total += food_eaten_day * 0.10
- percent_eaten_food = (food_eaten_total / food) * 100
- percent_eaten_dog = (food_eaten_dog_total / food_eaten_total) * 100
- percent_eaten_cat = (food_eaten_cat_total / food_eaten_total) * 100
- print(f"Total eaten biscuits: {round(biscuits_eaten_total)}gr.")
- print(f"{percent_eaten_food:.2f}% of the food has been eaten.")
- print(f"{percent_eaten_dog:.2f}% eaten from the dog.")
- print(f"{percent_eaten_cat:.2f}% eaten from the cat.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement