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