Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- days = int(input())
- all_food = float(input())
- biscuits = 0
- food_dog = 0
- food_cat = 0
- eaten_food =0
- precent_dog = 0
- precent_cat = 0
- precent_eaten = 0
- for day in range (1, days + 1):
- eatfood_dog = int(input())
- eatfood_cat = int(input())
- food_dog += eatfood_dog
- food_cat += eatfood_cat
- if day % 3 == 0:
- biscuits = (eatfood_dog + eatfood_cat) * 0.1
- eaten_food = food_dog + food_cat
- precent_eaten = eaten_food / all_food * 100
- precent_dog = food_dog / eaten_food * 100
- precent_cat = food_cat / eaten_food * 100
- print(f"Total eaten biscuits: {round(biscuits)}gr.")
- print(f"{precent_eaten:.2f}% of the food has been eaten.")
- print(f"{precent_dog:.2f}% eaten from the dog.")
- print(f"{precent_cat:.2f}% eaten from the cat.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement