grach

2016_July_17_2016 Harvest

Aug 15th, 2017
112
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 Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int X = int.Parse(Console.ReadLine());
  14.             double Y = double.Parse(Console.ReadLine());
  15.             double Z = double.Parse(Console.ReadLine());
  16.             int Workers = int.Parse(Console.ReadLine());
  17.  
  18.             var totalGrape = X * Y;
  19.             var wine = ((40*(totalGrape / 2.5)/100));
  20.  
  21.             if (wine>=Z)
  22.             {
  23.                 Console.WriteLine($"Good harvest this year! Total wine: {Math.Floor(wine)} liters.");
  24.                 Console.WriteLine($"{Math.Ceiling(wine-Z)} liters left -> {Math.Ceiling((wine- Z)/Workers)} liters per person.");
  25.             }
  26.  
  27.             else
  28.             {
  29.                 Console.WriteLine($"It will be a tough winter! More {Math.Floor(Z-wine)} liters wine needed.");                
  30.             }
  31.  
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment