Problem1176--Java 创建二维数组并将其元素输出

1176: Java 创建二维数组并将其元素输出

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 112  Solved: 0
[Submit] [Status] [Web Board] [Creator:]

Description

程序运行后,输出如下结果:

1111
2222 
3333 
4444

代码如下:

public class Java_2 {
    public static void main(String[] args) {
        int[][] aMatrix = {{1, 1, 1, 1}, {2, 2, 2, 2}, {3, 3, 3, 3}, {4, 4, 4, 4}};
        int i = 0; //循环变量 
        int j = 0; //循环变量 
        //*********Found******** 
        for (i = 0; i < ________________; i++) {
            for (j = 0; j < aMatrix[i].length; j++) {
                //*********Found******** 
                System.out.print(________________ + " ");
            }
            System.out.println();
        }
        System.out.print("a");
    }
}

Sample Output

1111
2222
3333
4444
a

Source/Category