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 Pets
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int food = int.Parse(Console.ReadLine());
- double dogFood = double.Parse(Console.ReadLine());
- double catFood = double.Parse(Console.ReadLine());
- double turtleFood = double.Parse(Console.ReadLine());
- double dogF = dogFood * days;
- double catF = catFood * days;
- double turtleF = turtleFood / 1000 * days;
- double totalFood = dogF + catF + turtleF;
- if (totalFood <= food)
- {
- Console.WriteLine("{0} kilos of food left.", Math.Floor(food - totalFood));
- }
- else
- {
- Console.WriteLine("{0} more kilos of food are needed.", Math.Ceiling(totalFood - food));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment