public class D {
public static void main(String[] args) { System.out.println("请输入数字(最大十位数):");
Scanner sc = new Scanner(System.in);
int sun = sc.nextInt();
System.out.println("已输入:"+sun);
int result = 0;
int i = 0;
while (true){
int n = sun%10;
if (n == -1){
break;
}
i++;
System.out.println("倒数第"+i+"位="+n);
result = result*10+n;
sun = sun/10; if (sun == 0){
break;
} }
}
}