We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6236e7f commit 7fc1b7dCopy full SHA for 7fc1b7d
JavaHackerrank/Java1DArray.java
@@ -0,0 +1,20 @@
1
+import java.util.*;
2
+
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
+ a[i] = scan.nextInt();
12
+ }
13
+ scan.close();
14
15
+ // Prints each sequential element in array a
16
+ for (int i = 0; i < a.length; i++) {
17
+ System.out.println(a[i]);
18
19
20
+}
0 commit comments