As shown below:
package day 4; import java.util.Scanner; public class Number inversion { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Please enter an integer: "); int num=sc.nextInt(); int result=0;//Save the inverted number while(true) { int n=num%10;//Retrieve the number on the lowest bit//You can also print it out directly System.out.println(n); but it is not good, you can also save it in an array, which is not good, because of the problem of 0 before and after flip result=result*10+n;//Reverse the number in turn to store the inverted number num=num/10;//Down if(num==0) { break; } } System.out.println(result); } }The above is the full content of the java input number and invert the output value of this number (implementation method) brought to you. I hope it will be helpful to everyone and support Wulin.com more~