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 nai_evtin_transport
- {
- class Program
- {
- static void Main(string[] args)
- {
- double km = double.Parse(Console.ReadLine());
- string vreme = Console.ReadLine();
- double taxiDay = 0.70 + km * 0.79;
- double taxiNight = 0.70 + km * 0.90;
- double bus = 0.09 * km;
- double train = 0.06 * km;
- if (km < 20 && vreme == "day")
- {
- Console.WriteLine($"{taxiDay:F2}");
- }
- else if (km < 20 && vreme == "night")
- {
- Console.WriteLine($"{taxiNight:F2}");
- }
- else if (km >= 20 && km < 100)
- {
- Console.WriteLine($"{bus:F2}");
- }
- else if (km >= 100 )
- {
- Console.WriteLine($"{train:F2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement