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 Cena_na_transport
- {
- class Program
- {
- static void Main(string[] args)
- {
- var km = int.Parse(Console.ReadLine());
- string time = Console.ReadLine();
- var dkmTaxi = 0.79;
- var nkmTaxi = 0.90;
- var tarifTaxi = 0.70;
- var price = 0.0;
- if (km <20)
- {
- if(time=="day")
- {
- price = (km * dkmTaxi) + tarifTaxi;
- }
- else if (time=="night")
- {
- price = (km * nkmTaxi) + tarifTaxi;
- }
- }
- if (km >20 && km<100)
- {
- price = km * 0.09;
- }
- else if(km>100)
- {
- price = km * 0.06;
- }
- {
- Console.WriteLine(price);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement