Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TransportPrice
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- string dayOrNight = Console.ReadLine();
- double taxiDay = 0.70 + n * 0.79 ;
- double taxiNight = 0.70 +n * 0.90;
- double bussDayNight = 0.09;
- double trainDayNight = 0.06;
- if (n <= 20 && dayOrNight == "day")
- {
- Console.WriteLine(taxiDay);
- }
- else if (n <= 20 && dayOrNight == "night")
- {
- Console.WriteLine($"{taxiNight:F2}");
- }
- else if (n >= 20 && n <= 100)
- {
- Console.WriteLine(bussDayNight * n);
- }
- else if (n >= 100)
- {
- Console.WriteLine($"{trainDayNight * n:F2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement