代码正确,为什么就显示运行成功,输出错误 分数最高的是伏晨,分数是98
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
class Program
{
static void Main(string[] args)
{
string[] name = { "吴松", "钱东宇", "伏晨", "陈陆", "周蕊", "林日鹏", "何昆", "关欣" };
int[] score = { 89, 90, 98, 56, 60, 91, 93, 85 };
string maxname =name[0];
int max =score[0];
for(int i=1;i<score.Length;i++)
{
if(score[i]>max)
{
max=score[i];
maxname=name[i];
}
}
Console.WriteLine("分数最高的是{0},分数是{1}",maxname,max);
}
}
}