1 using System; 2 public class GradeLevel{ 3 public static void Main( ){ 4 Console.Write("Input Grade Level: "); 5 char grade = (char) Console.Read(); 6 switch( char.ToUpper( grade ) ){ 7 case ‘A‘ : 8 Console.WriteLine(grade+" is 85~100"); 9 break; 10 case ‘B‘ : 11 Console.WriteLine(grade+" is 70~84"); 12 break; 13 case ‘C‘ : 14 Console.WriteLine(grade+" is 60~69"); 15 break; 16 case ‘D‘ : 17 Console.WriteLine(grade+" is <60"); 18 break; 19 default : 20 Console.WriteLine("input error"); 21 break; 22 } 23 } 24 } 25 26 来自 <http://www.icourse163.org/learn/PKU-1001663016?tid=1002052006>