Advertisement
fbinnzhivko

Harvest

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