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 ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- var xKvMeterLoze = int.Parse(Console.ReadLine());
- var yGrozdeForOneKvMeter = double.Parse(Console.ReadLine());
- var zNujniLitterVino = int.Parse(Console.ReadLine());
- var countWorkers = int.Parse(Console.ReadLine());
- var allGrozde = xKvMeterLoze * yGrozdeForOneKvMeter;
- var vino = (0.4 * allGrozde) / 2.5;
- if(vino >= zNujniLitterVino)
- {
- Console.WriteLine($"Good harvest this year! Total wine: {Math.Floor(vino)} liters.");
- var extraWine = Math.Ceiling(vino - zNujniLitterVino);
- Console.WriteLine($"{Math.Ceiling(extraWine)} liters left -> {Math.Ceiling(extraWine / countWorkers)} liters per person.");
- }
- else if(vino < zNujniLitterVino)
- {
- Console.WriteLine($"It will be a tough winter! More {Math.Floor(zNujniLitterVino - vino)} liters wine needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement