Advertisement
Spocoman

Food For Pets

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