菜鸟的博客

纵有疾风起,人生不言弃。

导航

2023.7.17 周一:多维数组

 1 import java.sql.SQLOutput;
 2 import java.util.Scanner;
 3 //多维数组
 4 public class test {
 5     public static void main(String[] args) {
 6         Scanner sc = new Scanner(System.in);
 7        int[][] array = new int[3][4];
 8        for(int i = 0;i<3;i++){
 9            for(int j = 0;j<4;j++){
10                array[i][j] = sc.nextInt();
11            }
12        }
13        System.out.println("====================");
14         for(int i = 0;i<3;i++){
15             for(int j = 0;j<4;j++){
16                 System.out.print(array[i][j]+" ");
17             }
18             System.out.println();
19         }
20        sc.close();
21     }
22 }

 

posted on 2023-07-17 11:29  hhmzd233  阅读(8)  评论(0)    收藏  举报