Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TransportPrice
- {
- class TransportPrice
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- string Time = Console.ReadLine();
- double Bus = n * .09;
- double Train = n * .06;
- bool a = ((n >= 1) && (n <= 5000) && !(n > 5000));
- if ((n < 20) && a)
- {
- if (Time == "day")
- {
- Console.WriteLine(n * .79 + .7);
- }
- else
- if (Time == "night")
- {
- Console.WriteLine(n * .9 + .7);
- }
- }
- else
- {
- if ((n >= 20) && (n < 100) && a)
- {
- Console.WriteLine(Bus);
- }
- else
- if ((n >= 100) && a)
- {
- double Min = Math.Min(Bus, Train);
- Console.WriteLine(Min);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement