Advertisement
koksibg

NumbersInReversedOrder

Oct 27th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class NumbersInReversedOrder {
  4.     public static void main(String[] args) {
  5.         Scanner input = new Scanner(System.in);
  6.         String number = input.nextLine();
  7.         StringBuilder number1 = new StringBuilder();
  8.         number1.append(number);
  9.         number1 = number1.reverse();
  10.         for (int i = 0; i < number1.length(); i++)
  11.             System.out.print(number1.charAt(i));
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement