Advertisement
koksibg

TransportPrice

Jun 29th, 2016
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TransportPrice
  4.  
  5. {
  6.     class TransportPrice
  7.  
  8.     {
  9.         static void Main()
  10.         {
  11.             int n = int.Parse(Console.ReadLine());
  12.             string Time = Console.ReadLine();
  13.             double Bus = n * .09;
  14.             double Train = n * .06;
  15.             bool a = ((n >= 1) && (n <= 5000) && !(n > 5000));
  16.             if ((n < 20) && a)
  17.             {
  18.                 if (Time == "day")
  19.                 {
  20.                 Console.WriteLine(n * .79 + .7);
  21.                 }
  22.                 else
  23.                 if (Time == "night")
  24.                 {
  25.                 Console.WriteLine(n * .9 + .7);
  26.                 }
  27.             }
  28.             else
  29.             {
  30.                 if ((n >= 20) && (n < 100) && a)
  31.                 {
  32.                 Console.WriteLine(Bus);
  33.                 }
  34.                 else
  35.                 if ((n >= 100) && a)
  36.                 {
  37.                 double Min = Math.Min(Bus, Train);
  38.                 Console.WriteLine(Min);
  39.                 }    
  40.             }
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement