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