摘要: //顺序结构的串 #include<stdio.h> #include<string.h> #include<malloc.h> #define MAXSIZE 100 struct string{ char elem[MAXSIZE]; int length; }; int sub_string( 阅读全文
posted @ 2019-09-29 09:50 JackieDYH 阅读(2) 评论(0) 推荐(0) 编辑
摘要: //顺序栈 #include<stdio.h> #include<malloc.h> #define MAXSIZE 100 struct stack { //建立结构体 int elem[MAXSIZE]; int top; }; //struct stack *s; //建立一个包含两个元素的栈 阅读全文
posted @ 2019-09-29 09:49 JackieDYH 阅读(5) 评论(0) 推荐(0) 编辑
摘要: //链式栈 #include<stdio.h> #include<malloc.h> struct node { int data; struct node *next; }; void in_stack(struct node *top,int x) //入栈 { struct node *p; 阅读全文
posted @ 2019-09-29 09:48 JackieDYH 阅读(6) 评论(0) 推荐(0) 编辑
摘要: //链栈 #include<stdio.h> #include<malloc.h> struct node{ int data; struct node *next; }; main() { struct node *top,*p,*q; int x; scanf("%d",&x); top=(st 阅读全文
posted @ 2019-09-29 09:47 JackieDYH 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<malloc.h> struct node{ //定义一个结构体 int data; struct node *next; }; void input_linklist(struct node *l) //建立一个名为l的链表 { int i; 阅读全文
posted @ 2019-09-29 09:45 JackieDYH 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int max(int a,int b,int c) {int max=a; if(max<b) max=b; if(max<c) max=c; return max; } main() {int a,b,c; scanf("%d%d%d",&a,&b,&c); 阅读全文
posted @ 2019-09-29 09:39 JackieDYH 阅读(2) 评论(0) 推荐(0) 编辑