using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 输入三个double类型的数
{
    public class score
    {
       
        public double[] scores=new double[4];
           public  double XunXu(double[] score1)
            {
                int i;
                int j;
                double t;
                
this.scores[4] = score1[4];
未处理 System.IndexOutOfRangeException
  Message="索引超出了数组界限。"
  Source="输入三个double类型的数"
  StackTrace:
       在 输入三个double类型的数.score.XunXu(Double[] score1) 位置 G:\c#程序\输入三个double类型的数\输入三个double类型的数\Program.cs:行号 18
       在 输入三个double类型的数.Program.Main(String[] args) 位置 G:\c#程序\输入三个double类型的数\输入三个double类型的数\Program.cs:行号 50
       在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
                for (i = 0; i < 2; i++)
                    for (j = i + 1; j < 3; j++)
                    {
                        if (scores[i] < scores[j])
                        {
                            t = scores[i];
                            scores[i] = scores[j];
                            scores[j] = t;
                        }
                    }
                return scores[3];
            }
       
    }
    class Program
    {
        static void Main(string[] args)
        {
            int i;
           
            score s = new score();
            double Shu;
            double[] a=new double[4];
            Random rand = new Random();
            for (i = 0; i < 3; i++)
            {
                a[i] = rand.Next(100);
            }
            Shu = s.XunXu(a);
            for (i = 0; i < 3; i++)
            { 
                Console.WriteLine(a[i]);
            }
        }
    }
}
还是不会改???
