Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- public class Lesson5HM4_12 {
- public static void main(String args[]) {
- String[] a = {"Привет ", " меня ", " зовут ", " Макс"};
- int n = a.length;
- String text;
- for (int i = 0; i < n / 2; i++) {
- text = a[n - i - 1];
- a[n - i - 1] = a[i];
- a[i] = text;
- }
- for (int i = 0; i < a.length; i++) {
- System.out.print(a[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement