As shown below:
The fourth day of package;
Import Java.util.Scanner;
public class numeric 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;//number while
(true)
{
int n=num%10;//take out the lowest digit
//can also be printed directly System.out.println (n But not good, also can use an array to save up, also bad, because of the flip of the 0 problem before and after the inverse of the
result=result*10+n;//in turn to store the inverted digital
num=num/10;//
if ( num==0)
{break
;
}
}
SYSTEM.OUT.PRINTLN (result);
}
The above is small series for everyone to bring the Java input a number, reverse output this number of the value (Implementation method) of the entire content, hope to help you, a lot of support cloud Habitat Community ~