Guest User

Untitled

a guest
Jan 16th, 2017
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.59 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 _02.TransportPrice
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var n = int.Parse(Console.ReadLine());
  14.  
  15.             if (n < 1 || n > 5000)
  16.             {
  17.                 Console.WriteLine("Wrong number");
  18.             }
  19.             else
  20.             {
  21.                 var t = Console.ReadLine();
  22.  
  23.                 if (t == "day")
  24.                 {
  25.                     if (n < 20)
  26.                     {
  27.                         Console.WriteLine((n * 0.79) + 0.7);
  28.                     }
  29.                     else if (n < 100)
  30.                     {
  31.                         Console.WriteLine(n * 0.09);
  32.  
  33.                     }
  34.                     else if (n <= 5000)
  35.                     {
  36.                         Console.WriteLine(n * 0.06);
  37.                     }
  38.                 }
  39.                 else if (t == "night")
  40.                 {
  41.                     if (n < 20)
  42.                     {
  43.                         Console.WriteLine((n * 0.9) + 0.7);
  44.                     }
  45.                     else if (n < 100)
  46.                     {
  47.                         Console.WriteLine(n * 0.09);
  48.                     }
  49.                     else if (n <= 5000)
  50.                     {
  51.                         Console.WriteLine(n * 0.06);
  52.                     }
  53.                 }
  54.                 else
  55.                 {
  56.                     Console.WriteLine("Wrong word");
  57.                 }
  58.             }
  59.         }
  60.     }
  61. }
Add Comment
Please, Sign In to add comment