为什么跑出来结果不一样呢?
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
class Program
{
static void Main(string[] args)
{
string[] name = new string[]{"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int[] score = new int[]{89,90,98,56,60,91,93,85};
int max,i,j;
for(i=1,j=1;i<score.Length;i++){
max=score[0];
if(max<score[i]){
max=score[i];
j=i;
}
}
Console.WriteLine("分数最高的是{0},分数是{1}",name[j],score[j]);
}
}
}
结果:分数最高的是何昆,分数是93