Title Description
Description: Enter an integer that will output the integer in reverse order as a string
The program does not consider the case of negative numbers, if the number contains 0, then the reverse form also contains 0, if the input is 100, then the output is 001
Input Description: Enter an int integer
Output Description: The integer is output in reverse order in the form of a string
Input Example: 1516000
Output Example: 0006151
Live with StringBuilder's reverse ()
Packageprctice01;ImportJava.util.Scanner;/*Title Description: Enter an integer, the integer in the form of a string to reverse the output program does not consider the case of negative numbers, if the number contains 0, the reverse form also contains 0, if the input is 100, then the output is 00 Input Description: Enter an int integer output description: This integer is reversed in the form of a string output input example: 1516000 Output Example: 0006151*/ Public classReverseNumber19 { Public Static voidMain (string[] args) {Scanner input=NewScanner (system.in); while(Input.hasnextline ()) {Char[] num =input.nextline (). ToCharArray (); for(inti = num.length-1;i>=0;i--) {System.out.print (num[i]); } } }}
19:reversenumber numbers upside down