Advertisement
EmoRz

Harvest

Jun 29th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Harvest
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int squareM = int.Parse(Console.ReadLine());
  10.             var squareMR = squareM * 0.4;
  11.             double grapeSM = double.Parse(Console.ReadLine())*squareMR;
  12.             var vine = grapeSM / 2.5;
  13.             var needLiterV = int.Parse(Console.ReadLine());
  14.             var numWorkers = int.Parse(Console.ReadLine());
  15.             if (vine>=needLiterV)
  16.             {
  17.                 Console.WriteLine($"Good harvest this year! Total wine: {Math.Truncate(vine)} liters.");
  18.                 Console.WriteLine($"{Math.Ceiling(vine-needLiterV)} liters left -> {Math.Ceiling((vine-needLiterV)/numWorkers)} liters per person.");
  19.             }
  20.             else
  21.             {
  22.                 Console.WriteLine($"It will be a tough winter! More {Math.Floor(needLiterV-vine)} liters wine needed.");
  23.             }      
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement