Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MyApp // Note: actual namespace depends on the project name.
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- // от реколтата на лозя се заделя 40 % за вино
- // за един литър вино са нужни 2,5 кг. грозде
- // достатъчно ли е виното
- int landM3 = int.Parse(Console.ReadLine());
- double grapesPerrM3 = double.Parse(Console.ReadLine());
- int wineNead = int.Parse(Console.ReadLine());
- int numWorcers = int.Parse(Console.ReadLine());
- double wineHave = ((landM3 * grapesPerrM3) * 0.4) /2.5;
- if (wineHave < wineNead)
- {
- double neadW = Math.Floor(wineNead - wineHave);
- Console.WriteLine($"It will be a tough winter! More {neadW} liters wine needed.");
- }
- else
- {
- double wine = Math.Floor(wineHave);
- double litersleft =Math.Ceiling (wineHave - wineNead);
- double winePerWorcer = Math.Ceiling(litersleft / numWorcers);
- Console.WriteLine($"Good harvest this year! Total wine: { wine} liters.");
- Console.WriteLine($"{litersleft} liters left -> {winePerWorcer} liters per person.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement