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=double.MaxValue ;
- double bus=double.MaxValue ;
- double train=double.MaxValue ;
- double price = 0;
- if (dayOrNight == "day")
- {
- taxi = 0.70 + (n * 0.79);
- Console.WriteLine(taxi);
- }
- else if (dayOrNight == "night")
- {
- taxi= (0.70 + 0.90 * n);
- }
- if (n >= 20)
- {
- bus = n * 0.09;
- }
- if (n >= 100)
- {
- train = 0.06 * n;
- }
- price = Math.Min(Math.Min(taxi, bus),train);
- Console.WriteLine(price);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement