import java.util.*;
public class Mian {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Stack<Integer> stack = new Stack<>();
int s = 0;
while (sc.hasNextInt()) {
int i = sc.nextInt();
if (i == 0){
break;
}
stack.push(i);
s++;
}
for (int j = 0; j < s; j++) {
System.out.printf(stack.pop()+" ");
}
}
}
为什么我这个编译失败,我的电脑上是可以编译的