这段代码有什么问题吗,大家帮我看下,老是运行失败说索引超出数组界限
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
class Program
{
static void Main(string[] args)
{
string[]name=new string[]{"苦熬","煎熬","和奥","你个","伏晨",};
int[]num=new int[]{21,31,54,54,99};
int i;
i=num[0];
for(int x=1;x<num.Length;x++)
{
if(num[x]>i)
{
i=num[x];
}
}
Console.WriteLine("分数最高的是{0},分数是{1}",name[i],num[i]);
}
}
}