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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int area = int.Parse(Console.ReadLine());
- double grapeperMeter = double.Parse(Console.ReadLine());
- int Winerequired = int.Parse(Console.ReadLine());
- int workers = int.Parse(Console.ReadLine());
- double totalGrape = (area*grapeperMeter) * 0.4;
- double TotalWine = totalGrape / 2.5;
- double difference = Winerequired - TotalWine;
- double difference1 = TotalWine - Winerequired;
- double wineperperson = difference1 / workers;
- if (TotalWine < Winerequired)
- {
- Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(difference));
- }
- else if (TotalWine >= Winerequired)
- {
- Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(TotalWine));
- Console.WriteLine("{0} liters left -> {1} liters per person.", Math.Ceiling(difference1), Math.Ceiling(wineperperson));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement