题解 | #反向输出一个四位数#
反向输出一个四位数
http://www.nowcoder.com/practice/1f7c1d67446e4361bf4af67c08e0b8b0
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int num = in.nextInt();
int[] result = new int[4];
result[0] = num % 10;
result[1] = num / 10 % 10;
result[2] = num / 100 % 10;
result[3] = num / 1000;
for(int i = 0; i < 4; i++){
System.out.print(result[i]);
}
}
}