pavlinski78

Untitled

Dec 14th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. number_days = int(input())
  2. total_food = float(input())
  3. sum_dog_food = 0
  4. sum_cat_food = 0
  5. bisquits = 0
  6. food_per_day = 0
  7. for i in range(1, number_days +1):
  8.     dog_food = float(input())
  9.     sum_dog_food += dog_food
  10.     cat_food = float(input())
  11.     sum_cat_food += cat_food
  12.     food_per_day = dog_food + cat_food
  13.     if i % 3 == 0:
  14.         bisquits += 0.1 * (food_per_day)
  15.         print(f"Total eaten biscuits: {bisquits:.0f}gr.")
  16.         print(f"{((sum_dog_food + sum_cat_food)/total_food*100):.2f}% of the food has been eaten.")
  17.         print(f"{(sum_dog_food/(sum_cat_food + sum_dog_food)*100):.2f}% eaten from the dog.")
  18.         print(f"{(sum_cat_food / (sum_dog_food + sum_cat_food) * 100):.2f}% eaten from the cat.")
Advertisement
Add Comment
Please, Sign In to add comment