Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int days = int.Parse(Console.ReadLine());
- int kilos = int.Parse(Console.ReadLine());
- double dailyF1 = double.Parse(Console.ReadLine());
- double dailyF2 = double.Parse(Console.ReadLine());
- double cat1 = dailyF1 * days;
- double cat2 = dailyF2 * days;
- double allfood = cat1 + cat2;
- if(allfood <= kilos)
- {
- Console.WriteLine("The cats are well fed.");
- Console.WriteLine("{0} kilos of food left.", Math.Ceiling(kilos - allfood));
- }
- else
- {
- Console.WriteLine("The cats are hungry.");
- Console.WriteLine("{0} more kilos of food are needed.", Math.Floor(allfood - kilos));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement