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 _02.TransportPrice
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- if (n < 1 || n > 5000)
- {
- Console.WriteLine("Wrong number");
- }
- else
- {
- var t = Console.ReadLine();
- if (t == "day")
- {
- if (n < 20)
- {
- Console.WriteLine((n * 0.79) + 0.7);
- }
- else if (n < 100)
- {
- Console.WriteLine(n * 0.09);
- }
- else if (n <= 5000)
- {
- Console.WriteLine(n * 0.06);
- }
- }
- else if (t == "night")
- {
- if (n < 20)
- {
- Console.WriteLine((n * 0.9) + 0.7);
- }
- else if (n < 100)
- {
- Console.WriteLine(n * 0.09);
- }
- else if (n <= 5000)
- {
- Console.WriteLine(n * 0.06);
- }
- }
- else
- {
- Console.WriteLine("Wrong word");
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment