import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
        //System.out.println("Hello world!");
        
        Scanner scn = new Scanner(System.in);

            int n = scn.nextInt();
            int nv = 0;

            /*boolean negative = false;
            if (n<0){
                n = n*-1;
                negative = true;
            }*/
            
            while(n>0){
                int d = n%10;
                nv =nv*1 + d;
                n=n%10;
            }

            /*if (negative == true){
                nv = nv*-1; 
            }*/

            System.out.println(nv);
        */
        
    }
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: