Guest User

Untitled

a guest
Dec 17th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. package com.gmail.sergiopartner;
  2.  
  3. import java.util.Arrays;
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7.  
  8. public static void main(String[] args) {
  9. Scanner sc = new Scanner(System.in);
  10. int n;
  11. System.out.println("Input size of array");
  12. n = sc.nextInt();
  13. int[] a = new int[n];
  14. int b = 1;
  15.  
  16. for (int i = 0; i < a.length; i += 1) {
  17. System.out.println("Input number " + b);
  18. a[i] = sc.nextInt();
  19. b += 1;
  20.  
  21. }
  22. System.out.println("Congratulation you creat new array of " + n + " numbers!!!");
  23. System.out.println("And he has look " + Arrays.toString(a));
  24.  
  25. }
  26.  
  27. }
Add Comment
Please, Sign In to add comment