Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Harvest
- {
- class Program
- {
- static void Main(string[] args)
- {
- // read input
- double vineyardArea = double.Parse(Console.ReadLine());
- double grapePerSquare = double.Parse(Console.ReadLine());
- double Neededliters = double.Parse(Console.ReadLine());
- double workers = double.Parse(Console.ReadLine());
- //count grapes per kg
- var harvestPerVine = 0.4 * vineyardArea * grapePerSquare;
- var vine = harvestPerVine / 2.5;
- if (vine >= Neededliters)
- {
- var vineLeft = vine - Neededliters;
- Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(vine)); //Кой е placeholder-а? Ако е vine (защо има Math.Floor) пред него?
- Console.WriteLine("{0} liters left -> {1} liters per person");
- }
- else
- {
- Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(Neededliters - vine));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement