Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Pets
- {
- class Program
- {
- static void Main(string[] args)
- {
- var NumberOfDays=int.Parse(Console.ReadLine());
- var LeftFoodKg= int.Parse(Console.ReadLine());
- var DogFoodKg = double.Parse(Console.ReadLine());
- var CatFoodKg = double.Parse(Console.ReadLine());
- var TurtleFoodGr = double.Parse(Console.ReadLine());
- TurtleFoodGr = TurtleFoodGr * 0.001;
- var countFood = DogFoodKg* NumberOfDays + CatFoodKg* NumberOfDays + TurtleFoodGr* NumberOfDays;
- if (countFood < LeftFoodKg)
- {
- Console.WriteLine("{0} kilos of food left.",Math.Floor(LeftFoodKg - countFood));
- }
- else
- {
- Console.WriteLine("{0} more kilos of food are needed.",Math.Ceiling (countFood-LeftFoodKg));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment