看板 java 關於我們 聯絡資訊
一道題目以泛型型態儲存5個小於50的亂數 TreeSer<Integer> ts = new TreeSet<Integer>(); for(int i=0; i<5; i++){ ts.add((int)(Math.random()*50+1)); } 其中最後的 +1 是為了甚麼 煩請指教 http://ideone.com/0uJU9 編譯失敗是為甚麼@@ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.128.195.235
PsMonkey:System.out.print(Math.random()*2) 多跑幾次就知道 06/16 14:02
※ 編輯: coilion9670 來自: 140.128.195.235 (06/16 15:11)