Advertisement
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 TransportPrice
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- string dayOrNight = Console.ReadLine();
- double taxi = 0;
- double bus = 0;
- double train = 0;
- switch (dayOrNight)
- {
- case "day":
- if (n >= 20 && n <= 99)
- {
- Console.WriteLine(bus += 0.09 * n);
- }
- else if (n >= 100)
- {
- Console.WriteLine(train += 0.06 * n);
- }
- else
- {
- Console.WriteLine(taxi += 0.7 + 0.79 * n);
- }
- break;
- case "night":
- if (n >= 20 && n <= 99)
- {
- Console.WriteLine(bus += 0.09 * n);
- }
- else if (n >= 100)
- {
- Console.WriteLine(train += 0.06 * n);
- }
- else
- {
- Console.WriteLine(taxi += 0.7 + 0.90 * n);
- }
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement