Advertisement
Guest User

Untitled

a guest
Jul 17th, 2016
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 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 _2.Harvest
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var area = int.Parse(Console.ReadLine());
  14. var grapePerMeter = double.Parse(Console.ReadLine());
  15. var wineNeeded = int.Parse(Console.ReadLine());
  16. var workers = int.Parse(Console.ReadLine());
  17. var totalGrapes = area * grapePerMeter;
  18. var wine = (0.4 * totalGrapes) / 2.5;
  19. var residue = Math.Abs(wine - wineNeeded);
  20. if (wine >= wineNeeded)
  21. {
  22. Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(wine));
  23. Console.WriteLine("{0} liters left -> {1} liters per person.", Math.Ceiling(residue), Math.Ceiling(residue / workers));
  24. }
  25. else
  26. {
  27. Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(residue));
  28. }
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement