#include<bits/stdc++.h>
using namespace std;
struct queste{
int x[101],y[101];
};
int main(){
queste a;
int top=0,n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
int opt;
scanf("%d",&opt);
if(opt==1){
top++;
scanf("%d%d",&a.x[++top],&a.y[top]);
}
else{
if(top==0){
printf("error\n");
}
else{
printf("%d %d\n",a.x[top],a.y[top]);
top--;
}
}
}
return 0;
}
为什么第15行
scanf("%d%d",&a.x[++top],&a.y[top]);里面不可以写++top呢,只能写top