题解 | #数字颠倒#
数字颠倒
http://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
其实我一开始是想用StringBuilder里的reverse()来做的。。。
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int tmp = 0;
do{
tmp = num % 10;
num = num / 10;
System.out.print(tmp);
}while(num != 0);
}
}