Advertisement
Guest User

Untitled

a guest
Sep 5th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. double x = double.Parse(Console.ReadLine());
  8. double y = double.Parse(Console.ReadLine());
  9. double z = double.Parse(Console.ReadLine());
  10. double rab = double.Parse(Console.ReadLine());
  11. double total = 0.4 * (x * y) / 2.5;
  12. if (total >= z)
  13. {
  14. Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(total));
  15. Console.WriteLine("{0} liters left -> {1} liters per person.", Math.Ceiling(total - z), Math.Ceiling((total - z) / rab));
  16. }
  17. else
  18. {
  19. Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(z - total));
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement