Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. package com.company;
  2.  
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7. public static void main(String[] args) {
  8. Scanner console = new Scanner(System.in);
  9. int count = console.nextInt();
  10. int myArray[]= new int [count];
  11.  
  12. for (int i =0; i < myArray.length ; i++) {
  13. int number=console.nextInt();
  14. myArray[i]=number;
  15. }
  16.  
  17. for (int i = 0 ; i < myArray.length ; i++) {
  18. System.out.print(myArray[i]);
  19. }
  20.  
  21. for (int i = myArray.length - 1; i>= 0 ; i--) {
  22. System.out.print(myArray[i]);
  23. }
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement