• 利用if else 求已发奖金总数


     class Program
        {
            static void Main(string[] args)
            {
                while (true)
                {
                    double i,s,a,b,c,d,e,f;
                 
                    Console.Write("请输入当月利润:");
                    i = Convert.ToDouble(Console.ReadLine());
                    a = Convert.ToDouble(i * 0.1);
                    b = Convert.ToDouble((i - 100000) * 0.075 + 10000);
                    c = Convert.ToDouble((i - 200000) * 0.05 + 17500);
                    d = Convert.ToDouble((i - 400000) * 0.03 + 27500);
                    e = Convert.ToDouble((i - 600000) * 0.015 + 33500);
                    f = Convert.ToDouble((i - 1000000) * 0.01 + 39500);
                    if (i <= 100000)
                    {
                        Console.WriteLine(a);
                    }
                    else if (i > 100000 && i <= 200000)
                    {
                        Console.WriteLine(b);
                    }
                    else if (i > 200000 && i <= 400000)
                    {
                        Console.WriteLine(c);
                    }
                    else if (i > 400000 && i <= 600000)
                    {
                        Console.WriteLine(d);
                    }
                    else if (i > 600000 && i <= 1000000)
                    {
                        Console.WriteLine(e);
                    }
                    else if (i > 1000000)
                    {
                        Console.WriteLine(f);
                    }
                    else
                    {
                        Console.WriteLine("请输入正确的金额");
                    }
                  
                   
                    Console.ReadLine();
                }
               
            }
        }
    }

  • 相关阅读:
    golang-uuid
    golang-random随机数
    git status检测不到文件变化
    vimium
    go1.11新特性,mark一下
    HTML网页滚动加载--mark一下
    docker-清理none镜像等操作
    golang websocket
    postman 快捷方式--启动图标
    tmux基本操作
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4375621.html
Copyright © 2020-2023  润新知