c#100 计算行李重量

using System;
using System.Collections.Generic;
using System.Text;
 
namespace ConsoleApplication1
{
    class 行李重量
    {
        static void Main(string[] args)
        {
 
            {
                Double a;
                while (true)
                {
                    Console.Write("请输入行李重量(kg)");
 
                     a = Convert.ToDouble(Console.ReadLine());
 
 
 
                    if (a >= 0 && a <= 50)
                    {
                        Double g = a * 0.25;
                        Console.WriteLine("您的运费为"+(a*0.25)+"元");
 
 
                    }
                    else if (a > 50)
                    {
                        Console.WriteLine("您的运费为"+(a*0.25+(a-50)*0.4) +"元");
                    }
                    else
                    {
                        Console.WriteLine("您的输入有误");
                    }
 
console.readline();
                }
            }
        }
    }
}
posted @ 2015-04-19 09:45  王文姿  阅读(234)  评论(0编辑  收藏  举报