Skip to content

Instantly share code, notes, and snippets.

@KingSirLee
Created March 31, 2013 14:21
Show Gist options
  • Save KingSirLee/5280720 to your computer and use it in GitHub Desktop.
Save KingSirLee/5280720 to your computer and use it in GitHub Desktop.
将任意数字倒置输出
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