Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace DeerOfSanta
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- double foods = double.Parse(Console.ReadLine());
- double deer1 = double.Parse(Console.ReadLine());
- double deer2 = double.Parse(Console.ReadLine());
- double deer3 = double.Parse(Console.ReadLine());
- double neededFood = (deer1 + deer2 + deer3) * days;
- if (foods >= neededFood)
- {
- Console.WriteLine($"{Math.Floor(foods - neededFood)} kilos of food left.");
- }
- else
- {
- Console.WriteLine($"{Math.Ceiling(neededFood - foods)} more kilos of food are needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement