Advertisement
stoychevamaria89

Untitled

Apr 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3.  
  4. public class PrintSixNumbersBackward {
  5. public static void main(String[] args){
  6. Scanner scanner = new Scanner(System.in);
  7. int[] nArray = new int[6];
  8. int[] nArrayBackwards = new int[6];
  9. for(int i = 0; i<6; i++){
  10. nArray[i] = scanner.nextInt();
  11.  
  12. }
  13. for(int j=0; j<6; j++){
  14. nArrayBackwards[6-j-1] = nArray[j];
  15. }
  16. System.out.println(Arrays.toString(nArrayBackwards));
  17.  
  18.  
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement