fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. Scanner read = new Scanner(System.in);
  11. int num= read.nextInt();
  12.  
  13. String numStr = Integer.toString(num);
  14. for(int i = numStr.length() -1 ; i >= 0; --i)
  15. {
  16. System.out.print(numStr.charAt(i));
  17. }
  18. }
  19. }
  20.  
Success #stdin #stdout 0.11s 380672KB
stdin
1234
stdout
4321