Skip to content

Commit fc3a43f

Browse files
authored
Update 1dArray.java
1 parent bbac65b commit fc3a43f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1+
import java.util.*;
12

3+
public class Solution {
4+
5+
public static void main(String[] args) {
6+
7+
Scanner scan = new Scanner(System.in);
8+
int n = scan.nextInt();
9+
int [] a = new int[n];
10+
for(int i = 0; i < a.length; i++)
11+
{
12+
a[i] = scan.nextInt();
13+
}
14+
scan.close();
15+
16+
// Prints each sequential element in array a
17+
for (int i = 0; i < a.length; i++) {
18+
System.out.println(a[i]);
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)