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