标签:
{
while (true)
{
double x;
Console.WriteLine("请输入坐车距离");
x = Convert.ToDouble(Console.ReadLine());
if (x <= 3&&x>0)
{
Console.WriteLine("给我8块钱");
}
else if (x > 3 && x <= 5)
{
Console.WriteLine("给我"+(8+(x-3)*1.2)+"块钱");
}
else if (x > 5)
{
Console.WriteLine("给我" + ((8 + 2.4) + (x - 5) * 1.5) + "块钱");
}
else
{
Console.WriteLine("你蒙我呢");
}
Console.ReadLine();
标签:
原文地址:http://www.cnblogs.com/g-pf/p/4373957.html