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 Harvest
- {
- class Program
- {
- static void Main(string[] args)
- {
- int X = int.Parse(Console.ReadLine());
- double Y = double.Parse(Console.ReadLine());
- double Z = double.Parse(Console.ReadLine());
- int Workers = int.Parse(Console.ReadLine());
- var totalGrape = X * Y;
- var wine = ((40*(totalGrape / 2.5)/100));
- if (wine>=Z)
- {
- 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.");
- }
- else
- {
- Console.WriteLine($"It will be a tough winter! More {Math.Floor(Z-wine)} liters wine needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment