最新回答 / weixin_宝慕林9321889
Console.WriteLine("分数最高的是{0},分数是{1}",name[k],score[k]);改为Console.WriteLine("分数最高的是{0},分数是{1}",name[k],score[k]);
2020-09-29
同学们注意审题两个数组
string[] name = new string[] {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int[] score = new int[] { 89,90,98,56,60,91,93,85 };
int max = 0;
string ws= "";
for (int a=0;a<= 7;a++)
{
if (max<score[a])
{
max =score[a];
ws =name[a];
}
}
Console.Write("分数最高的是{0},分数是{1},", ws,max);
string[] name = new string[] {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int[] score = new int[] { 89,90,98,56,60,91,93,85 };
int max = 0;
string ws= "";
for (int a=0;a<= 7;a++)
{
if (max<score[a])
{
max =score[a];
ws =name[a];
}
}
Console.Write("分数最高的是{0},分数是{1},", ws,max);