- import java.util.Scanner;
- public class Ch16
- {
- public static void main(String args[])
- {
- int n[][]={{1,2,3,4},{5,6,7,8},{9,10,11,12}};
- for(int i=0; i<3; i++)
- {
- for(int j=0; j<4; j++)
- System.out.println("n["+i+"]["+j+"]="+n[i][j]);
- }
- }
- }import java.util.Scanner;
- public class Ch16
- {
- public static void main(String args[])
- {
- int n[][]={{1,2,3,4},{5,6,7,8},{9,10,11,12}};
- for(int i=0; i<3; i++)
- {
- for(int j=0; j<4; j++)
- System.out.println("n["+i+"]["+j+"]="+n[i][j]);
- }
- }
- }
複製代碼 |