-
-
Save KingSirLee/5280720 to your computer and use it in GitHub Desktop.
将任意数字倒置输出
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Dao{ | |
public static void main(String[]args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
System.out.println("请输入要倒置的数字:"); | |
int a=input.nextInt(); | |
while(a!=0){ | |
int b=a%10; | |
System.out.print(b); | |
a=a/10; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment