BorislavBorisov

17.03.Garden мое решение

Sep 29th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. using System+;
  2. class Garden
  3. {
  4.     static void Main()
  5.     {
  6.         decimal tomatoSeed = decimal.Parse(Console.ReadLine()) * 0.5m;
  7.         byte tomatoArea = byte.Parse(Console.ReadLine());
  8.  
  9.         decimal cucumberSeed = decimal.Parse(Console.ReadLine()) * 0.4m;
  10.         byte cucumberArea = byte.Parse(Console.ReadLine());
  11.  
  12.         decimal potatoSeed = decimal.Parse(Console.ReadLine()) * 0.25m;
  13.         byte potatoArea = byte.Parse(Console.ReadLine());
  14.  
  15.         decimal carrotSeed = decimal.Parse(Console.ReadLine()) * 0.6m;
  16.         byte carrotArea = byte.Parse(Console.ReadLine());
  17.  
  18.         decimal cabbageSeed = decimal.Parse(Console.ReadLine()) * 0.3m;
  19.         byte cabbageArea = byte.Parse(Console.ReadLine());
  20.  
  21.         decimal beansSeed = decimal.Parse(Console.ReadLine()) * 0.4m;
  22.  
  23.         Console.WriteLine("Total costs: " + (tomatoSeed + cucumberSeed + potatoSeed +
  24.             carrotSeed + cabbageSeed + beansSeed));
  25.  
  26.         int beansArea = 250 - (tomatoArea + cucumberArea + potatoArea
  27.             + carrotArea + cabbageArea);
  28.         if(beansArea == 0)
  29.         {
  30.             Console.WriteLine("No area for beans");
  31.         }
  32.         else if(beansArea > 0)
  33.         {
  34.             Console.WriteLine("Beans area: " + beansArea);
  35.         }
  36.         else
  37.         {
  38.             Console.WriteLine("Insufficient area");
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment