ralirp

Untitled

Dec 15th, 2016
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 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 Pets
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var NumberOfDays=int.Parse(Console.ReadLine());
  14. var LeftFoodKg= int.Parse(Console.ReadLine());
  15. var DogFoodKg = double.Parse(Console.ReadLine());
  16. var CatFoodKg = double.Parse(Console.ReadLine());
  17. var TurtleFoodGr = double.Parse(Console.ReadLine());
  18. TurtleFoodGr = TurtleFoodGr * 0.001;
  19.  
  20.  
  21.  
  22. var countFood = DogFoodKg* NumberOfDays + CatFoodKg* NumberOfDays + TurtleFoodGr* NumberOfDays;
  23.  
  24. if (countFood < LeftFoodKg)
  25. {
  26.  
  27. Console.WriteLine("{0} kilos of food left.",Math.Floor(LeftFoodKg - countFood));
  28. }
  29. else
  30. {
  31.  
  32. Console.WriteLine("{0} more kilos of food are needed.",Math.Ceiling (countFood-LeftFoodKg));
  33. }
  34.  
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment