运行结果和要求的都一样了,为啥还说结果不对
没看出来哪里不一样了
没看出来哪里不一样了
2020-09-30
int sum = 0;
int pingjue = 0;
string[,] chenji = { { "景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"},
{ "90", "65", "88", "70", "46", "81", "100", "68" } };
for (int i = 0; i < (chenji.Length) / 2; i++)
{
sum+= int.Parse(chenji[1,i]);
}
pingjue = sum / ((chenji.Length) / 2);
Console.WriteLine($"平均分:{pingjue}");
Console.WriteLine("高于均分的同学有:");
for (int i = 0; i < (chenji.Length) / 2; i++)
{
if (int.Parse(chenji[1, i]) > pingjue)
{
Console.Write(chenji[0, i]+" ");
}
}
举报