・
수강평 2
・
평균평점 4.0
소스 테스트 package ccc; public class nVar { public static void main(String[] args) { int nvar = 1; int[][] nArray = { {1, 2}, {3, 4, 5} }; /* nArray = new int[3][]; nArray[0] = new int[2]; nArray[1] = new int[3]; nArray[2] = new int[5]; */ for (int i = 0; i < nArray.length; i++) { for(int j = 0; j < nArray[i].length; j++) { nArray[i][j] = nvar++; System.out.printf("%1$d ", nArray[i][j]); } System.out.println(); } } } ============= Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '1' at java.base/java.util.Formatter.checkText(Formatter.java:2748) at java.base/java.util.Formatter.parse(Formatter.java:2734) at java.base/java.util.Formatter.format(Formatter.java:2671) at java.base/java.io.PrintStream.format(PrintStream.java:1209) at java.base/java.io.PrintStream.printf(PrintStream.java:1105) at ccc.nVar.main(nVar.java:18)