Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Produce
- {
- class Program
- {
- static void Main(string[] args)
- {
- var area = int.Parse(Console.ReadLine());
- var grapesKGPerSQM = double.Parse(Console.ReadLine());
- var wineNeeded = double.Parse(Console.ReadLine());
- var workers = double.Parse(Console.ReadLine());
- var harvestForWine = (area * grapesKGPerSQM)*0.4;
- var wine = harvestForWine / 2.5;
- var totalWine = Math.Truncate(wine);
- if (wine < wineNeeded)
- {
- Console.WriteLine("It will be a tough winter! More {0} liters wine needed.",
- Math.Truncate(wineNeeded-wine));
- }
- else
- {
- Console.WriteLine("Good harvest this year! Total wine: {0} liters.",
- Math.Truncate(wine));
- Console.WriteLine("{0} liters left -> {1} liters per person.",
- Math.Round(totalWine-wineNeeded),
- Math.Round((totalWine - wineNeeded)/workers));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement