整数翻转

/*
题目:整数翻转
内容:

以下程序把一个整数翻转(8765变为:5678),请补充缺少的代码。

int n = 8765;
int m = 0;
while(n>0)
{
m = ________________________;
n = n / 10;
}
System.out.println(m);


*/

 1 class pro26{
 2     public static void main(String[] args){
 3         int n = 8765;
 4         int m = 0;
 5         while(n>0)
 6         {
 7             m = m*10 + n%10;
 8             n = n / 10;
 9         }        
10         System.out.println(m);
11     }
12 }

/*
简单题,
*/

原文地址:https://www.cnblogs.com/wsxjbky/p/3059017.html