看板 [ java ]
討論串[問題] 排序
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者superlubu (叔叔你人真好)時間17年前 (2008/09/18 22:32), 編輯資訊
0
0
0
內容預覽:
有點投機取巧的做法 XD. int result = o1.length() - o2.length();. if (result != 0) return result;. return o1.compareTo(o2);. --. 《為了要得到真相,就要向原 PO 伸圖》. 那就是伸圖魔人的沒圖

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者LyinZ (琳子)時間17年前 (2008/09/18 21:47), 編輯資訊
0
0
0
內容預覽:
Arrays.sort(s, new Comparator<String>() {. public int compare( String o1, String o2 ) {. return Integer.parseInt(o1.substring(2)) - Integer.parseInt(o

推噓10(10推 0噓 7→)留言17則,0人參與, 最新作者buubuu (buu)時間17年前 (2008/09/18 21:19), 編輯資訊
0
0
0
內容預覽:
我使用Array.sort(s)去排序. String[] s={"閃電1","閃電12","閃電3","閃電4","閃電5","閃電2","閃電21","閃電10"}. 本來想要的結果是. 閃電1,閃電2,閃電3,閃電4,閃電5,閃電10,閃電12,閃電21. 但排序出來會是閃電1,閃電10,閃電
(還有94個字)
首頁
上一頁
1
下一頁
尾頁