Advertisement
sivancheva

Harvest

Apr 30th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 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 harvest
  8. {
  9. class harvest
  10. {
  11. static void Main(string[] args)
  12. {
  13. var areaX = int.Parse(Console.ReadLine());
  14. var dobivY = double.Parse(Console.ReadLine());
  15. var wineWhish = int.Parse(Console.ReadLine());
  16. var employees = int.Parse(Console.ReadLine());
  17.  
  18. var areaWIne = 40 * areaX / 100; //
  19. var wineL = areaWIne * dobivY / 2.5; // vino v litri
  20.  
  21.  
  22. if (wineL < wineWhish)
  23. {
  24. var nedostigWine = Math.Floor(wineWhish-wineL);
  25.  
  26. Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", nedostigWine);
  27. }
  28. else if (wineL >= wineWhish)
  29. {
  30. var pove4eWine = (wineL - wineWhish);
  31. var totalWine = Math.Floor(wineWhish + pove4eWine);
  32. var vinoZaEmployees = pove4eWine/employees;
  33. Console.WriteLine("Good harvest this year! Total wine: {0} liters.", totalWine);
  34. Console.WriteLine("{0} liters left -> {1} liters per person.", Math.Round(pove4eWine), Math.Round(vinoZaEmployees));
  35.  
  36. }
  37.  
  38. }
  39. }
  40. }
  41. //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement