Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ReverseString {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String originalString = sc.nextLine();
- String reverseString = "";
- for(int i = originalString.length()-1;i>=0;i--){
- reverseString = reverseString + originalString.charAt(i);
- }
- System.out.println(reverseString);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement