Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Harvest
- {
- class Program
- {
- static void Main()
- {
- double x = double.Parse(Console.ReadLine());
- double y = double.Parse(Console.ReadLine());
- double z = double.Parse(Console.ReadLine());
- int workers = int.Parse(Console.ReadLine());
- double wine = 0.4 * x * y / 2.5;
- if (wine < z)
- {
- Console.WriteLine($"It will be a tough winter! More {Math.Floor(z - wine)} liters wine needed.");
- }
- else
- {
- Console.WriteLine($"Good harvest this year! Total wine: {Math.Floor(wine)} liters.");
- Console.WriteLine($"{Math.Ceiling(wine - z)} liters left -> {Math.Ceiling((wine - z) / workers)} liters per person.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment