Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n = int.Parse(Console.ReadLine());
- string time = Console.ReadLine();
- double price = 0;
- if (n < 20) // Такси
- {
- if (time == "day")
- {
- price = 0.7 + n * 0.79;
- }
- else
- {
- price = 0.7 + n * 0.9;
- }
- }
- else if (n < 100) // Автобус
- {
- price = n * 0.09;
- }
- else // Влак
- {
- price = n * 0.06;
- }
- Console.WriteLine($"{price:F2}");
Advertisement
Add Comment
Please, Sign In to add comment