Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- double x = double.Parse(Console.ReadLine());
- double y = double.Parse(Console.ReadLine());
- double z = double.Parse(Console.ReadLine());
- double rab = double.Parse(Console.ReadLine());
- double grozde = x * y;
- double total = 0.4 * grozde / 2.5;
- if (total >= z)
- {
- double litr = Math.Ceiling(total - z);
- double litrPer = Math.Ceiling(litr / rab);
- Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(total));
- Console.WriteLine("{0} liters left -> {1} liters per person.", litr, litrPer);
- }
- else
- {
- Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(z - total));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment