Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package textProcessing;
- import java.util.Scanner;
- public class P01ReverseStrings {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String text = scanner.nextLine();
- while (!text.equals("end")) {
- String reverseWord = "";
- for (int i = text.length() - 1; i >= 0; i--) {
- char symbol = text.charAt(i);
- reverseWord = reverseWord + symbol;
- }
- System.out.printf("%s = %s%n", text, reverseWord);
- text = scanner.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement