用栈做的啊
#include<iostream> using namespace std; int a[101]; int top=0,c; int main() { while(1) { cin>>c; if(c==0) break; top++; a[top]=c; } while(top!=0) { cout<<a[top--]<<" "; } return 0; }
个人觉得没有问题,洛谷也是对的,只是在编译器里给CE了,为什么? 求大佬解答