C#中 的switch

using System;

namespace switch_
{
    class Program
{
    static void Main(string[] args)
    {
        int salary = 0;
        Console.WriteLine("请输入张三的等级");
        string level = Console.ReadLine();
        switch (level)
        {
            case "A": salary += 100;
                break;
            case "B":
                salary += 200;
                break;
            case "C":
                salary += 300;
                break;
            case "D":
                salary += 400;
                break;
            default:Console.WriteLine("输入有误");
                break;
        }
        Console.WriteLine("张三的工资为{0}", salary);
        Console.ReadKey();
    }
}
}

上一篇:习惯性朴实简单!一起学习MySQL常见单行函数,字符数学日期流程控制


下一篇:SQL60 统计salary的累计和running_total