Advertisement
drunin89

02. Harvest

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