Advertisement
dradoslavov

02.Pets

Jan 27th, 2017
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _02.Pets
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var days = int.Parse(Console.ReadLine());
  14.             var KgFood = int.Parse(Console.ReadLine());
  15.             var DogFood = double.Parse(Console.ReadLine());
  16.             var CatFood = double.Parse(Console.ReadLine());
  17.             var TurtleFood = double.Parse(Console.ReadLine())/1000;
  18.  
  19.             var TotalKGFood = (DogFood + CatFood + TurtleFood) * days;
  20.             if (TotalKGFood>KgFood)
  21.             {
  22.                 TotalKGFood -= KgFood;
  23.                 Console.Write("{0} kilos of food left",Math.Floor(TotalKGFood));
  24.             }
  25.             else
  26.             {
  27.                
  28.             }
  29.  
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement