//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)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 临海市| 休宁县| 岳普湖县| 沙田区| 海口市| 永吉县| 将乐县| 云安县| 双柏县| 呼图壁县| 深州市| 文成县| 将乐县| 新民市| 肥东县| 江山市| 嘉兴市| 太谷县| 久治县| 稻城县| 荥阳市| 岳西县| 天台县| 弥渡县| 武城县| 文化| 龙里县| 大名县| 老河口市| 托克逊县| 芒康县| 高雄县| 中牟县| 安宁市| 博客| 南投市| 昌平区| 东宁县| 桐庐县| 平阴县| 汶上县|