日期:2014-05-17  浏览次数:21020 次

数组倒序输出的问题,贴出代码,各位给看看?
  public static void Write3(List<GroundLine.CrossSection> firsList, string filename)
        {
            StreamWriter file = new StreamWriter(filename);
            for (int i = 0; i < firsList.Count; i++)
            {
                file.WriteLine("    " + firsList[i].Stake.Value + "    " + firsList[i].Elevation);
                KeyValuePair<double, double>[] leftlist2 = firsList[i].LeftList.ToArray();
                string leftList1 = "";
                double left = 0;
                double laft = 0;
                for (int m = 0; m< leftlist2.Length; m++)
                {
                    double aleva = firsList[i].Elevation;
                    laft = (aleva + leftlist2[m].Value) + laft;
                    
                    double eleva = leftlist2[m].Key;
                    if (m == 0)
                    {
                        left = eleva;
                    }
                    if (m < leftlist2.Length - 1)
                    {
                        left = left + leftlist2[m + 1].Key;
                    }
                    else
                    {