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 day = double.Parse(Console.ReadLine());
- var foodKg = int.Parse(Console.ReadLine());
- var dogFood = double.Parse(Console.ReadLine());
- var catFood = double.Parse(Console.ReadLine());
- var turtleFood = double.Parse(Console.ReadLine())/1000;
- var dog = day * dogFood;
- var cat = day * catFood;
- var turtle = day * (turtleFood);
- var total = dog + cat + turtle;
- if (total<=foodKg)
- {
- Console.WriteLine($"{Math.Floor(foodKg-total)} kilos of food left.");
- }
- else
- Console.WriteLine($"{Math.Ceiling(total-foodKg)} more kilos of food are needed.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment