-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArraySample.java
More file actions
42 lines (37 loc) · 1016 Bytes
/
Copy pathArraySample.java
File metadata and controls
42 lines (37 loc) · 1016 Bytes
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
import java.util.Scanner;
public class ArraySample {
public static void main(String[] args) {
// int sample[];
// int n;
// Scanner scanner = new Scanner(System.in);
// n = scanner.nextInt();
//
// sample = new int[n];
// for(int i = 0; i < sample.length; i++) {
// sample[i] = i * 10;
// }
//
// int temp[] = new int[sample.length + 1];
//
// for(int i = 0; i < sample.length; i++) {
// temp[i] = sample[i];
// }
//
// temp[10] = 70;
//
// for(int i = 0; i < sample.length; i++) {
// System.out.println(sample[i]);
// }
int n2 = 4;
int[][] ire = new int[n2][];
for (int i = 0; i < n2; i++) {
ire[i] = new int[i + 1];
}
for (int i = 0; i < ire.length; i++) {
for (int j = 0; j < ire[i].length; j++) {
System.out.print(ire[i][j] + " ");
}
System.out.println();
}
}
}