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 ConsoleApplication21
- {
- class Program
- {
- static void Main(string[] args)
- {
- double x = double.Parse(Console.ReadLine());
- double y = double.Parse(Console.ReadLine());
- double z = double.Parse(Console.ReadLine());
- int persons = int.Parse(Console.ReadLine());
- double grapes =x * y;
- double wine;
- wine =(40 * grapes / 100) / 2.5;
- if (wine >= z)
- {
- double remains = wine - z;
- double wineForPersons = remains / persons;
- Console.WriteLine("Good harvest this year! Total wine: {0} liters.",Math.Floor(wine));
- Console.WriteLine("{0} liters left -> {1} liters per person.",Math.Ceiling(remains),
- Math.Ceiling(wineForPersons));
- }
- else if (wine < z)
- {
- double needOf = z - wine;
- Console.WriteLine("It will be a tough winter! More {0} liters wine needed.",Math.Floor(needOf));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment