Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. days = int(input())
  2. all_food = float(input())
  3. biscuits = 0
  4. food_dog = 0
  5. food_cat = 0
  6. eaten_food =0
  7. precent_dog = 0
  8. precent_cat = 0
  9. precent_eaten = 0
  10. for day in range (1, days + 1):
  11.     eatfood_dog = int(input())
  12.     eatfood_cat = int(input())
  13.     food_dog += eatfood_dog
  14.     food_cat += eatfood_cat
  15.  
  16.     if day % 3 == 0:
  17.         biscuits += (eatfood_dog + eatfood_cat) * 0.1
  18.  
  19. eaten_food = food_dog + food_cat
  20. precent_eaten = eaten_food / all_food * 100
  21. precent_dog = food_dog / eaten_food * 100
  22. precent_cat = food_cat / eaten_food * 100
  23.  
  24. print(f"Total eaten biscuits: {round(biscuits)}gr.")
  25. print(f"{precent_eaten:.2f}% of the food has been eaten.")
  26. print(f"{precent_dog:.2f}% eaten from the dog.")
  27. print(f"{precent_cat:.2f}% eaten from the cat.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement