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