Re: [問題] 想請問這段編譯哪裡有問題??
※ 引述《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
04/20 17:58, 1F
→
04/20 18:55, , 2F
04/20 18:55, 2F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):