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 silvanadoc
- {
- class silvanadoc
- {
- static void Main(string[] args)
- {
- int yard = int.Parse(Console.ReadLine());
- double berries = double.Parse(Console.ReadLine());
- int wantedWine = int.Parse(Console.ReadLine());
- int workers = int.Parse(Console.ReadLine());
- double allBerries = yard * berries;
- double producedWine = (allBerries * 0.4) / 2.5;
- double neededWine = wantedWine - producedWine;
- double leftWine = producedWine - wantedWine;
- double spredWine = leftWine / workers;
- if (producedWine < wantedWine)
- {
- Console.WriteLine($"It will be a tough winter! More {Math.Floor(neededWine)} liters wine needed.");
- }
- else
- {
- Console.WriteLine($"Good harvest this year! Total wine: {Math.Floor(producedWine)} liters.");
- Console.WriteLine($"{Math.Ceiling(leftWine)} liters left -> {Math.Ceiling(spredWine)} liters per person.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement