c 学生管理系统11(6)
时间:2025-04-23
时间:2025-04-23
班级q:退出查询");
string tmp = Console.ReadLine();
Console.WriteLine("学号姓名性别年龄联系方式联系地址班级班主任语文数学英语");
switch (tmp)
{
case "1":
Console.WriteLine("请输入学号:");
string xuehao = Console.ReadLine();
int a = 1;
for (int i = 0; i < xh.Length; i++)
{
if (xuehao == xh[i])
{
Console.WriteLine("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10}", xh[i], xm[i], xb[i], nl[i], dh[i], dz[i], bj[i], bz[i], yw[i], sx[i], yy[i]);
Console.WriteLine();
a = i;
break;
}
}
if (a == 1)//判断进没进入上一个if 没有就执行
{
Console.WriteLine("你输入的学号不存在!");
Console.WriteLine();
}
break;
case "2":
Console.WriteLine("请输入姓名:");
string xingming = Console.ReadLine();
int b = 1;
for (int i = 0; i < xh.Length; i++)
{
if (xingming == xm[i])
{
Console.WriteLine("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10}", xh[i], xm[i], xb[i], nl[i], dh[i], dz[i], bj[i], bz[i], yw[i], sx[i], yy[i]);
Console.WriteLine();
b = i;
}
}
if (b == 1)