質問: 0; i < 10; i++){ System.out.print("入力:"+test[i]); System.out.print("逆順出力:"+test[i]); } } }
回答: Java 勉強中です。 QA8293175.java: import java.util.*; public class QA8293175 { private static final Integer n = 10; public static void main(String[] args) { Scanner in = new Scanner(System.in); ArrayList result = new ArrayList(); ArrayList reverse = new ArrayList(); Integer i = 0; while (result.size() < n) { try { System.out.print("num " + (i + 1) + " ? "); result.add(new Integer(in.next())); i++; } catch (Exception e) { continue; } } System.out.println(result); for (Integer j = 0; j < n ; j++) { reverse.add(result.get(n - j - 1)); } System.out.println(reverse); } }