Advertisement
meteor4o

JF-04.ReverseArray

Jun 4th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3.  
  4. public class ReverseArrayStrings {
  5. public static void main(String[] args) {
  6.  
  7. Scanner sc = new Scanner(System.in);
  8.  
  9. String[] stringNew = sc.nextLine().split(" ");
  10.  
  11. for (int i = 0; i <= stringNew.length -1; i++) {
  12. String temp = stringNew[i];
  13. stringNew[i] = stringNew[stringNew.length -i - 1];
  14. System.out.print(stringNew[i] + " ");
  15. stringNew[i] = temp;
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement