fbinnzhivko

03. Пътешествие

May 3rd, 2016
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.72 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.  
  7.         decimal budjet = decimal.Parse(Console.ReadLine());
  8.         string season = Console.ReadLine();
  9.  
  10.         decimal total = (decimal)0;
  11.         if (season == "summer")
  12.         {
  13.             if (budjet <= 100)
  14.             {
  15.                 total = (decimal)0.7 * budjet;
  16.                 Console.WriteLine("Somewhere in Bulgaria");
  17.                 Console.WriteLine("Camp - {0:f2}", budjet - total);
  18.             }
  19.             else if (budjet <= 1000)
  20.             {
  21.  
  22.                 total = (decimal)0.6 * budjet;
  23.                 Console.WriteLine("Somewhere in Balkans");
  24.                 Console.WriteLine("Camp - {0:f2}", budjet - total);
  25.             }
  26.             else if (budjet > 1000)
  27.             {
  28.                 total = (decimal)0.9 * budjet;
  29.  
  30.                 Console.WriteLine("Somewhere in Europe");
  31.                 Console.WriteLine("Hotel - {0:f2}", total);
  32.             }
  33.         }
  34.         else
  35.         {
  36.             if (budjet <= 100)
  37.             {
  38.                 total = (decimal)0.3 * budjet;
  39.                 Console.WriteLine("Somewhere in Bulgaria");
  40.                 Console.WriteLine("Hotel - {0:f2}", budjet - total);
  41.             }
  42.             else if (budjet <= 1000)
  43.             {
  44.                 total = (decimal)0.2 * budjet;
  45.                 Console.WriteLine("Somewhere in Balkans");
  46.                 Console.WriteLine("Hotel - {0:f2}", budjet - total);
  47.             }
  48.             else if (budjet > 1000)
  49.             {
  50.                 total = (decimal)0.9 * budjet;
  51.  
  52.                 Console.WriteLine("Somewhere in Europe");
  53.                 Console.WriteLine("Hotel - {0:f2}", total);
  54.             }
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment