Advertisement
spasnikolov131

Untitled

Jun 1st, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Harvest
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. // read input
  10.  
  11. double vineyardArea = double.Parse(Console.ReadLine());
  12. double grapePerSquare = double.Parse(Console.ReadLine());
  13. double Neededliters = double.Parse(Console.ReadLine());
  14. double workers = double.Parse(Console.ReadLine());
  15.  
  16. //count grapes per kg
  17. var harvestPerVine = 0.4 * vineyardArea * grapePerSquare;
  18. var vine = harvestPerVine / 2.5;
  19. if (vine >= Neededliters)
  20. {
  21. var vineLeft = vine - Neededliters;
  22. Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(vine)); //Кой е placeholder-а? Ако е vine (защо има Math.Floor) пред него?
  23. Console.WriteLine("{0} liters left -> {1} liters per person");
  24. }
  25. else
  26. {
  27. Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(Neededliters - vine));
  28.  
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement