Console.WriteLine("请输入你对张三的评定等级。(A-E)");
string input = Console.ReadLine();
decimal salary = 5000;
bool flag = false;
switch (input)
{
case "A" :
salary +=500;
break;
case "B":
salary +=200;
break;
case "C":
break;
case "D":
salary -=200;
break;
case "E":
salary -=500;
break;
default:
Console.WriteLine("你的输入有误。");
flag = true;
break;
}
if (flag==false)
{
Console.WriteLine("张三的工资为"+salary);//这里为什么是+salary啊?????
}
Console.ReadKey();
}
|
|