Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- day = int(input())
- food_kg = float(input())
- dog_kg = float(input())
- cat_kg = float(input())
- turtle_gr = float(input())
- total_kg = dog_kg * day + cat_kg * day + turtle_gr / 1000 * day
- if food_kg >= total_kg:
- print(f'{math.floor(food_kg - total_kg)} kilos of food left.')
- else:
- print(f'{math.ceil(total_kg - food_kg)} more kilos of food are needed.')
- Тарикатско решение:)
- import math
- day = int(input())
- food_kg = float(input())
- total_kg = (float(input()) + float(input()) + float(input()) / 1000) * day
- if food_kg >= total_kg:
- print(f'{math.floor(food_kg - total_kg)} kilos of food left.')
- else:
- print(f'{math.ceil(total_kg - food_kg)} more kilos of food are needed.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement