Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace rekolta
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             double plosht = double.Parse(Console.ReadLine());
  15.             double Grozde = double.Parse(Console.ReadLine()); // kg grozde ot 1 kvadraten metar
  16.             double VinoZaProdan = double.Parse(Console.ReadLine());
  17.             int rabotnici = int.Parse(Console.ReadLine());
  18.  
  19.  
  20.             double LitriGrozde = plosht * Grozde;
  21.             double vino = LitriGrozde * 0.4 / 2.5;
  22.  
  23.             double razlika = Math.Abs(VinoZaProdan - vino);
  24.             double VinoRabotnici = Math.Floor(razlika / rabotnici);
  25.  
  26.             if (vino >= VinoZaProdan)
  27.             {
  28.                 Console.WriteLine("Good harvest this year! Total wine: {0} liters.",Math.Floor(vino));
  29.                 Console.WriteLine("{0} liters left -> {1} liters per person.",Math.Floor(razlika),VinoRabotnici);
  30.  
  31.  
  32.             }
  33.  
  34.             else
  35.             {
  36.                 Console.WriteLine("It will be a tough winter! More {0} liters wine needed.",Math.Floor(razlika));
  37.             }
  38.  
  39.  
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement