grodek118

Reverse

Mar 19th, 2022
968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.  
  8.     public static void main(String[] args) {
  9.         Scanner input = new Scanner(System.in);
  10.         System.out.println("Wprowadź zdanie: ");
  11.         String text = input.nextLine();
  12.         StringBuilder reverse = new StringBuilder(text);
  13.         reverse.reverse();
  14.         System.out.println("Zdanie po zamianie: " + reverse);
  15.  
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment