Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2020
949
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import math
  2.  
  3. days = int(input())
  4. food = float(input())
  5.  
  6. total = 0
  7. dog = 0
  8. cat = 0
  9. biscuits = 0
  10. for i in range(1,days+1):
  11. food_eaten_by_dog = int(input())
  12. dog += food_eaten_by_dog
  13. food_eaten_by_cat = int(input())
  14. cat += food_eaten_by_cat
  15. total += food_eaten_by_cat + food_eaten_by_dog
  16. if i%3 == 0:
  17. biscuits += round(((food_eaten_by_cat + food_eaten_by_dog) * 0.10))
  18.  
  19. print(f'Total eaten biscuits: {biscuits}gr.')
  20. print(f'{total/food*100:.2f}% of the food has been eaten.')
  21. print(f'{dog/total*100:.2f}% eaten from the dog.')
  22. print(f'{cat/total*100:.2f}% eaten from the cat.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement