不用default标签,应该如何改写程序???急急急
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace switch分数等级
{
class Program
{
static void Main(string[] args)
{
Console.Write(“请输入分数:”);
double f = Convert.ToDouble(Console.ReadLine());
string d;
if (f > 100 || f < 0)
{
Console.Write(“请输入正确的分数”);
Console.ReadLine();
return;
}
switch ((int)(f / 10))
{
case 10:
case 9:
d = "优秀";
break;
case 8:
d = "良好";
break;
case 7:
d = "中等";
break;
case 6:
d = "合格";
break;
default:
d = "不合格";
break;
}
Console.Write("成绩等级为:{0}!", d);
Console.ReadLine();
}
}
}