Anzzhhela98

cff

Jun 23rd, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Вело_състезание
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int countJ = int.Parse(Console.ReadLine());
  10.             int countS = int.Parse(Console.ReadLine());
  11.             string trase = Console.ReadLine();
  12.             double money1 = 0;//juniors
  13.             double money2 = 0;//senors
  14.  
  15.             if (trase == "trail")
  16.             {
  17.                 money1 = 5.50;
  18.                 money2 = 7;
  19.             }
  20.             else if (trase == "cross-country")
  21.             {
  22.                 money1 = 8;
  23.                 money2 = 9.50;
  24.             }
  25.             else if (trase == "downhill")
  26.             {
  27.                 money1 = 12.25;
  28.                 money2 = 13.75;
  29.             }
  30.             else if (trase == "road")
  31.             {
  32.                 money1 = 20;
  33.                 money2 = 21.50;
  34.             }
  35.             double finalSum =( money1 * countJ)
  36.                 + (money2 * countS);
  37.             if (countJ+countS>=50)
  38.             {
  39.                 finalSum = finalSum * 0.75;
  40.             }
  41.             Console.WriteLine($"{finalSum*0.95:f2}");
  42.            
  43.         }
  44.     }
  45. }
Add Comment
Please, Sign In to add comment