GeorgiLukanov87

animals_food

Apr 7th, 2022 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. count_days = int(input())
  2. total_food = float(input())
  3. total_eaten_food = 0
  4. biscuits = 0
  5. total_dog_food = 0
  6. total_cat_food = 0
  7. for i in range(1, count_days + 1):
  8.     dog_food = int(input())
  9.     cat_food = int(input())
  10.     total_dog_food += dog_food
  11.     total_cat_food += cat_food
  12.     total_eaten_food += dog_food + cat_food
  13.     if i % 3 == 0:
  14.         biscuits += (dog_food + cat_food) * 0.10
  15. print(f"Total eaten biscuits: {round(biscuits)}gr.")
  16. print(f"{total_eaten_food/total_food*100:.2f}% of the food has been eaten.")
  17. print(f"{total_dog_food/total_eaten_food*100:.2f}% eaten from the dog.")
  18. print(f"{total_cat_food/total_eaten_food*100:.2f}% eaten from the cat.")
  19.  
Add Comment
Please, Sign In to add comment