正在加载图片...
return OK ∥ All Brackets Test 2001级通信6班张沐同学答案(已上机通过) #include<stdio.h> #include<stdlib h> void push( char x) void popo: void correct(enum Boolean &tag) ∥)原来的定义是 void correct( struct stack*head, enum boolean&tag) typedef struct Stack char data; struct Stack *next struct Stack head, p enum Boolean FALSE, TRUE tag head=(struct Stack *)malloc(sizeof( struct Stack)) head->data='S. head->next=NULL. l/ head 's data has not been initialized! correct(tag) printf("Right! " ) printf("Wrong!"); void push( char x) p=(struct Stack")malloc(sizeof(struct Stack)) if(!p) printf("There's = head head=p7 return OK; }//AllBrackets_Test 2001 级通信 6 班张沐同学答案(已上机通过) #include<stdio.h> #include<stdlib.h> void push(char x); void pop(); void correct(enum Boolean &tag); //原来的定义是 void correct(struct Stack* head,enum Boolean &tag); typedef struct Stack { char data; struct Stack *next; }; struct Stack *head,*p; enum Boolean{FALSE,TRUE}tag; void main() { head=(struct Stack*)malloc(sizeof(struct Stack)); head->data='S'; head->next=NULL; // head's data has not been initialized!! correct(tag); if(tag) printf("Right!"); else printf("Wrong!"); } void push(char x) { p=(struct Stack*)malloc(sizeof(struct Stack)); if(!p) printf("There's no space.\n"); else { p->data=x; p->next=head; head=p; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有