fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void display(int []arr, int N){
  11. for(int i =0; i<N; ++i)
  12. System.out.print(arr[i] + " ");
  13. System.out.println("");
  14. }
  15. public static void main (String[] args) throws java.lang.Exception
  16. {
  17. Scanner sc = new Scanner(System.in);
  18.  
  19. int arr[] = new int[100];
  20.  
  21.  
  22. int N = sc.nextInt();
  23.  
  24.  
  25. for(int i = 0; i<N; ++i)
  26. arr[i] = sc.nextInt();
  27.  
  28.  
  29. display(arr,N);
  30.  
  31.  
  32.  
  33. sc.close();
  34. }
  35. }
Success #stdin #stdout 0.17s 56940KB
stdin
5
1 2 3 4 10
stdout
1 2 3 4 10