Sichanov

food

Aug 13th, 2021
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. days = int(input())
  2. food = float(input())
  3.  
  4. sum_food = 0
  5. food_of_dog = 0
  6. food_of_cat = 0
  7. biscuits = 0
  8.  
  9. for i in range(1, days + 1):
  10.     quantity_of_dog = int(input())
  11.     quantity_of_cat = int(input())
  12.     food_of_dog += quantity_of_dog
  13.     food_of_cat += quantity_of_cat
  14.     sum_food += quantity_of_cat + quantity_of_dog
  15.  
  16.     if i % 3 == 0:
  17.         biscuits = (quantity_of_cat + quantity_of_dog) * 0.10
  18. print(f"Total eaten biscuits: {round(biscuits)}gr.")
  19. print(f"{(sum_food / food) * 100:.2f}% of the food has been eaten.")
  20. print(f"{(food_of_dog / sum_food) * 100:.2f}% eaten from the dog.")
  21. print(f"{(food_of_cat / sum_food) * 100:.2f}% eaten from the cat.")
Advertisement
Add Comment
Please, Sign In to add comment