출처: https://bumcrush.tistory.com/182 [맑음때때로 여름]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
    int [][] score= new int[5][3];
        
        /*
         ㅁㅁㅁ
         ㅁㅁㅁ
         ㅁㅁㅁ
         ㅁㅁㅁ
         ㅁㅁㅁ
         */
    
    
    int [][] score2=new int[5][];
        score2[0]=new int[4];                
        score2[1]=new int[3];
        score2[2]=new int[2];
        score2[3]=new int[2];
        score2[4]=new int[3];
        
        /*
         ㅁㅁㅁㅁ
         ㅁㅁㅁ
         ㅁㅁ
         ㅁㅁ
         ㅁㅁㅁ 
         
         */
        
    int [][] score3 = {
            {010203},
            {111212},
            {212223},
    };
    
            /*
             01 02 03
             11 12 12
             21 22 23
             */
    
 
 
 //예
 
    int[][]arr3= {
            {1,2},
            {3,4,5},
            {6,7,8,9},
        };
    
    for(int i=0; i<arr3.length ; i++) {
        for(int j=0; j<arr3[i].length; j++) {
            System.out.print(arr3[i][j]+"\t");}
    
    System.out.println();}
 
                
cs

+ Recent posts