Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Pets
- {
- class Program
- {
- static void Main()
- {
- int day = int.Parse(Console.ReadLine());
- double foodKg = double.Parse(Console.ReadLine());
- double dogKg = double.Parse(Console.ReadLine());
- double catKg = double.Parse(Console.ReadLine());
- double turtleGr = double.Parse(Console.ReadLine());
- double totalKg = dogKg * day + catKg * day + turtleGr / 1000 * day;
- if (foodKg >= totalKg)
- {
- Console.WriteLine($"{Math.Floor(foodKg - totalKg)} kilos of food left.");
- }
- else
- {
- Console.WriteLine($"{Math.Ceiling(totalKg - foodKg)} more kilos of food are needed.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment