110,539
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入学生人数人数:");
string a = Console.ReadLine();
int b = int.Parse(a);
int c = 1;
while (c <= b)
{
Console.WriteLine("请输入第{0}个学生的成绩:", c);
string d = Console.ReadLine();
int e = int.Parse(d);
if (e > 100)
{
Console.WriteLine("请不要输入这么大的数字!");
/////////////
break;
////////////
}
if (e < 60)
{
Console.Write("该同学的成绩类型为:");
Console.WriteLine("D");
}
else if (e <= 80)
{
Console.Write("该同学的成绩类型为:");
Console.WriteLine("C");
}
else if (e < 90)
{
Console.Write("该同学的成绩类型为:");
Console.WriteLine("B");
}
else
{
Console.Write("该同学的成绩类型为:");
Console.WriteLine("A");
}
c++;
}
Console.WriteLine("程序结束了,感谢您的使用,再见!");
Console.ReadLine();
}
}
}
if (e > 100)
{
Console.WriteLine("请不要输入这么大的数字!");
return;
}