using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TAXI
{
class Program
{
static void Main(string[] args)
{
float x, t, x1, x2;
Console.Write("nhap so KM da di :"); x = float.Parse(Console.ReadLine());
if (x <= 1)
{
t = 5000;
Console.Write("so tien ={0}d", t);
}
else
{
if (x <= 30)
{
x1 = x - 1;
int x01 = (int)(x1*1000 / 200 + 0.4);
t = 5000 + x01 * 1000;
Console.Write("so tien={0}d", t);
}
else
{
x2 = x - 30;
int x02 = (int)(x2 + 0.4);
t = 5000 * 30 + x02 * 3000;
Console.Write("so tien ={0}d", t);
}
}
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TAXI
{
class Program
{
static void Main(string[] args)
{
float x, t, x1, x2;
Console.Write("nhap so KM da di :"); x = float.Parse(Console.ReadLine());
if (x <= 1)
{
t = 5000;
Console.Write("so tien ={0}d", t);
}
else
{
if (x <= 30)
{
x1 = x - 1;
int x01 = (int)(x1*1000 / 200 + 0.4);
t = 5000 + x01 * 1000;
Console.Write("so tien={0}d", t);
}
else
{
x2 = x - 30;
int x02 = (int)(x2 + 0.4);
t = 5000 * 30 + x02 * 3000;
Console.Write("so tien ={0}d", t);
}
}
Console.ReadKey();
}
}
}