Advertisement
spasnikolov131

Untitled

May 7th, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Harvest
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int X = int.Parse(Console.ReadLine());
  10. double Y = double.Parse(Console.ReadLine());
  11. int Z = int.Parse(Console.ReadLine());
  12. int workersCount = int.Parse(Console.ReadLine());
  13.  
  14. double totalGrapse = X * Y;
  15. double wine = (0.4 * totalGrapse) / 2.5;
  16. if (wine >= Z)
  17. {
  18. double wineLeft = wine - Z;
  19. double wineFor1Worker = wineLeft / workersCount;
  20. Console.WriteLine($"Good harvest this year! Total wine: {wine} liters.");
  21. Console.WriteLine($"{wineLeft} liters left -> {wineFor1Worker} liters per person.");
  22.  
  23. }
  24. else if (wine < Z)
  25. {
  26. double wineLeft = Z - wine;
  27. Console.WriteLine($"It will be a tough winter! More {Math.Abs(wineLeft)} liters wine needed.");
  28.  
  29. }
  30.  
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement