Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Harvest_02
- {
- class Program
- {
- public static void Main(string[] args)
- {
- float vineyard = int.Parse(Console.ReadLine());
- float grapePerSquare = float.Parse(Console.ReadLine());
- float wineNeed = int.Parse(Console.ReadLine());
- float workers = int.Parse(Console.ReadLine());
- float totalGrape = vineyard*grapePerSquare;
- double totalWine = (double)totalGrape*(40.0/100)/2.5;
- if (totalWine >= wineNeed)
- {
- Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(totalWine));
- Console.WriteLine("{0} liters left -> {1} liters per person.", Math.Ceiling(totalWine-wineNeed), Math.Ceiling((totalWine-wineNeed)/workers));
- }
- else
- {
- Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(Math.Abs(totalWine-wineNeed)));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement