Advertisement
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 silvanadoc
- {
- class silvanadoc
- {
- static void Main(string[] args)
- {
- int daysOut = int.Parse(Console.ReadLine());
- int foodKept = int.Parse(Console.ReadLine());
- double dogFood = double.Parse(Console.ReadLine());
- double catFood = double.Parse(Console.ReadLine());
- double turtleFood = double.Parse(Console.ReadLine());
- var dogSum = daysOut * dogFood;
- var catSum = catFood * daysOut;
- var turtleSum = (turtleFood / 1000) * daysOut;
- var allFood = dogSum + catSum + turtleSum;
- var foodLeft = foodKept - allFood;
- var foodMore = allFood - foodKept;
- if (foodKept >= allFood)
- {
- Console.WriteLine($"{Math.Floor(foodLeft)} kilos of food left.");
- }
- else
- {
- Console.WriteLine($"{Math.Ceiling(foodMore)} more kilos of food are needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement