Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BikeRace
- {
- class Program
- {
- public static void Main()
- {
- int junior = int.Parse(Console.ReadLine());
- int senior = int.Parse(Console.ReadLine());
- string trace = Console.ReadLine();
- double junSum = 0;
- double senSum = 0;
- if (trace == "trail")
- {
- junSum = 5.5;
- senSum = 7;
- } else if (trace == "cross - country")
- {
- junSum = 8;
- senSum = 9.5;
- } else if (trace == "downhill")
- {
- junSum = 12.25;
- senSum = 13.75;
- } else if (trace == "road")
- {
- junSum = 20;
- senSum = 21.5;
- }
- double sum = junior * junSum + senior * senSum;
- if (trace == "cross - country" && junior + senior >= 50)
- {
- sum *= 0.75;
- }
- Console.WriteLine($"{ 0.95 * sum:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement