//ArrayList needs=new ArrayList();
          //            #region 加載測試數據
          //            for (int i = 0; i < 5; i++)
          //            {
          //                needs.Add(3);
          //            }
          //            for (int i = 0; i < 7; i++)
          //            {
          //                needs.Add(1.55);
          //            }
          //            for (int i = 0; i < 9; i++)
          //            {
          //                needs.Add(1.66);
          //            }
           
          //            #endregion

          //            //從大到小排序
          //            IComparer myComperMethod = new comper();
          //            needs.Sort(myComperMethod);

          //            string result = string.Empty;
          //            //迭代方法
          //            for (int i = 0; i < needs.Count; )
          //            {
          //                double temp =double.Parse(needs[i].ToString());
          //                ArrayList tempResult = new ArrayList();
          //                tempResult.Add(needs[i]);
          //                needs.RemoveAt(i);

          //                for (int j = 0; j < needs.Count; )
          //                {
          //                    if (temp + double.Parse(needs[j].ToString()) > 6)
          //                    {
          //                        j++;
          //                    }
          //                    else
          //                    {
          //                        temp += double.Parse(needs[j].ToString());
          //                        tempResult.Add(needs[j]);

          //                        needs.RemoveAt(j);
          //                    }
          //                }

          //                //記錄結果
          //                for (int k= 0; k < tempResult.Count; k++)
          //                {
          //                    result += tempResult[k].ToString() + ",";
          //                }
          //                result += "<br>";
          //            }
                     
          //            Response.Clear();
          //            Response.Write(result);
          //            Response.End();

          posted on 2011-03-07 16:08 sanmao 閱讀(140) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 海阳市| 白河县| 百色市| 凤城市| 洛南县| 恭城| 西林县| 日土县| 正定县| 兰考县| 青岛市| 海门市| 瑞安市| 莆田市| 浦江县| 迁安市| 通州区| 额尔古纳市| 十堰市| 蒙城县| 千阳县| 台山市| 潍坊市| 英吉沙县| 大埔县| 鄂托克前旗| 洛浦县| 威海市| 宜良县| 马边| 金华市| 马龙县| 牡丹江市| 韩城市| 黔南| 凌源市| 穆棱市| 宜都市| 内乡县| 灵璧县| 大连市|