问题描述:
输入学生成绩等级,判断是否通过,
源代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入成绩[A,B,C,D,E}:");
string s = Console.ReadLine().ToUpper();
switch(s)
{
case "A":
case "B":
case "C":
case "D":
Console.WriteLine("通过");
break;
case "E":
Console.WriteLine("不通过");
break;
default:
Console.WriteLine("输入成绩有误!");
break;
}
Console.ReadKey();
}
}
}
运行结果: