他哥叫粒粒Ω
陳特西ctx
关注数: 127
粉丝数: 271
发帖数: 6,024
关注贴吧数: 74
二战吧怎么又封了 二战吧怎么又封了
谁知道这款鞋编号是多少?现在在网上还能不能找到?
大神谁能看看这答题错在哪里?实在找不到是哪里错了 #include<stdio.h> #include<malloc.h> #define MaxSize 100 typedef char ElemType; typedef struct { ElemType elem[MaxSize]; int top; }SqStack; void InitStack(SqStack *s) { s=(SqStack *)malloc(sizeof(SqStack)); s->top=-1; } void ClearStack(SqStack *s) { free(s); } int StackLenghth(SqStack *s) { int len=0; while (s->top!=-1) { len++; s->top--; } s->top+=len; return len; } int StackEmpy(SqStack *s) { if(s->top==-1) { return 1; } else { return 0; } } int Push (SqStack *s,ElemType e) { if(s->top==MaxSize-1) { return 0; } s->top++; s->elem[s->top]=e; return 1; } int Pop(SqStack *s,ElemType e) { if(s->top==-1) { return 0; } else { e=s->elem[s->top]; s->top--; } return 1; } int GetTop(SqStack *s,ElemType *e) { if(s->top==-1) { return 0; } else { *e=s->elem[s->top]; } return 1; } void DispStack(SqStack *s) { while(s->top!=-1) { printf("%c\n",s->elem[s->top]); s->top--; } } int main () { ElemType e; SqStack *s; char x ,y; printf("(1)初始化栈s\n"); InitStack(s); printf("(2)栈为%s\n",(StackEmpy(s)?"空":"非空")); printf("(3)依次进栈元素a,b,c,d,e\n"); Push(s,'a'); Push(s,'b'); Push(s,'c'); Push(s,'d'); Push(s,'e'); printf("(4)输出栈s长度\n"); printf("%d\n",StackLenghth(s)); printf("(5)出栈一个元素\n"); Pop(s,x); printf("%c\n",x); printf("(6)取栈顶一个元素\n"); GetTop(s,&y); printf("%c\n",y); printf("(7)从栈顶到栈底输出元素\n"); DispStack(s); ClearStack(s); }
对于赵薇近日的事件怎么看? 对于赵薇近日的事件怎么看?
1
下一页