看板 java 關於我們 聯絡資訊
※ 引述《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
PsMonkey:請不要這麼直白的幫助版友...... Orz 04/20 17:58
cyberwizard:還好吧,該有的元素他都有了,只是點出問題 04/20 18:55