Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace dwdwdwdwDD
- {
- class Program
- {
- static void Main(string[] args)
- {
- var days = int.Parse(Console.ReadLine());
- var food = double.Parse(Console.ReadLine());
- var dogFood = double.Parse(Console.ReadLine());
- var catFood = double.Parse(Console.ReadLine());
- var turtleFood = double.Parse(Console.ReadLine());
- var totalFood = dogFood * days + catFood * days + (turtleFood / 1000.0) * days;
- food = food - totalFood;
- if (food < 0)
- {
- food = Math.Abs(food);
- food = Math.Ceiling(food);
- Console.WriteLine($"{food} more kilos of food are needed.");
- }
- else
- {
- food = Math.Floor(food);
- Console.WriteLine($"{food} kilos of food left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment