用WIN TC 编译得 可不知道怎样怎样改错误
#define MAXSIZE 100
typedef int datatype;
typedef struct
{
datatype data[MAXSIZE];
int top;
}SeqStack;
SeqStack *Init_seqstack()
{
SeqStack *s;
s=(SeqStack*)malloc(sizeof(SeqStack));
s->top=-1;
return s;
}
int Push_seqstack1(SeqStack *s,datatype x)
{
if(s->top==MAXSIZE-1) return 0;
else
{
printf("CHU SHI HUA ");
scanf("d%",&x);
while(x!=10)
{
s->top++;
s->data[s->top]=x;
return 1;
}
}
}
int Empty_seqstack(SeqStack *s)
{
if(s->top==-1) return 1;
else return 0;
}
int Pop_seqstack(SeqStack *s,datatype x)
{
if(Empty_seqstack(s)) return 0;
else
{
x=s->data[s->top];
s->top--;
return 1;
}
}
void main()
{
SeqStack *s1,*s2,*s3;
int y,z;
Init_seqstack(s1);
Init_seqstack(s2);
Init_seqstack(s3);
Push_seqstack(s1,y);
while(!Empty_seqstack(s1))
{
z= Pop_seqstack(s1,y);
Pushu_seqstack(s2,z) ;
}
while(!Empty_seqstack(s2))
{
z=Pop_seqstack(s1);
Push_seqstack(s3,z);
}
while(!Empty_seqstack(s3))
{
z=Pop_seqstack(s3);
Push_seqstack(s1,z);
}
getch();
}