Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package reversestring;
- import java.util.Scanner;
- public class ReverseString {
- public static void main(String[] args){
- Scanner sc = new Scanner(System.in);
- String input = sc.nextLine();
- String output = " ";
- String text = " ";
- String number = " ";
- char symbol = ' ';
- for (int i = 0; i < input.length(); i++) {
- symbol = input.charAt(input.length() - i - 1);
- text = String.valueOf(symbol);
- output += text;
- }
- System.out.print(output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement