如何在不使用
brake
的情况下重写这段代码?
我有密码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class Exercise23
{
static void Main(string[] args)
{
string notes;
char grade;
Console.Write("Input your value :");
grade = Convert.ToChar(Console.ReadLine());
switch (grade)
{
case 'E':
notes = " Excellent";
break;
case 'V':
notes = " Very Good";
break;
case 'G':
notes = " Good ";
break;
case 'A':
notes = " Average";
break;
case 'F':
notes = " Fails";
break;
default:
notes = "Invalid Value";
break;
}
Console.Write("Your chose is : {0}\n", notes);
}
}
我很好奇在每个
brake
之后看到不写case
的选项。
而且我真的不知道该怎么做。