码迷,mamicode.com
首页 > Windows程序 > 详细

c#100 计算行李重量

时间:2015-04-19 10:06:37      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

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();
                }
            }
        }
    }
}

c#100 计算行李重量

标签:

原文地址:http://www.cnblogs.com/w-wz/p/4438662.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!