编写一个程序,使用switch语句将用户输入的分数转换成等级,如表
private static void Main(string[] args)
{
Console.WriteLine("请输入分数:");
int score = int.Parse(Console.ReadLine());
switch (score)
{
case 90:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 97:
case 98:
case 99:
case 100:
Console.WriteLine("A");
break;
case 80:
case 81:
case 82:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
Console.WriteLine("B");
break;
case 70:
case 71:
case 72:
case 73:
case 74:
case 75:
case 76:
case 77:
case 78:
case 79:
Console.WriteLine("C");
break;
case 60:
case 61:
case 62:
case 63:
case 64:
case 65:
case 66:
case 67:
case 68:
case 69:
Console.WriteLine("D");
break;
default:
Console.WriteLine("E");
break;
}
}