String[][] names=new String[3][2]; // 通过二重循环输出二维数组中元素的值 Scanner sc=new Scanner(System.in); for(int i=0;i<=names.length;i++) { for(int j=0;j<=names[i].length;) names[i][j]=sc.nextLine(); } for (int i = 0; i < names.length ; i++) { for ( int j = 0; j < names[i].length; j++) { System.out.println( Arrays.toString(names[i])); } System.out.println(); }
添加回答
举报
0/150
提交
取消