Re: [問題] 想請問這段編譯哪裡有問題??

看板java作者 (Gavin)時間13年前 (2012/04/20 17:13), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《d1288999 (@凌凌七@)》之銘言: : import java.io. : import java.util.*; : public class test12 { : public static void main(String[] args){ : System.out.println("請輸入九個數字"); : int[] x = new int[9]; ArrayList<Integer> x = new ArrayList<Integer>() : Scanner sc = new Scanner(new BufferedInputStream(System.in)); : while(sc.hasNext()) { while(sc.hasNextInt()){ 多餘的 for-loop : for(int i=0;i<9;i++){ : x[i]=sc.nextInt(); : } 改成 x.add(sc.nextInt); : } : } : } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.85.140

04/20 17:58, , 1F
請不要這麼直白的幫助版友...... Orz
04/20 17:58, 1F

04/20 18:55, , 2F
還好吧,該有的元素他都有了,只是點出問題
04/20 18:55, 2F
文章代碼(AID): #1FaIYSSc (java)
文章代碼(AID): #1FaIYSSc (java)