题解 | #数字颠倒#
数字颠倒
http://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
import java.util.*; public class Main{ public static void toOut(int num){ List<Integer> intNum = new ArrayList<>(); while(num>0){ intNum.add((num%10)); num /= 10; } for(int data:intNum){ System.out.print(data); } } public static void main(String[] args){ Scanner in = new Scanner(System.in); int num = in.nextInt(); toOut(num); } }