摘要: #include<stdio.h> int gy(int m,int n) {int r; if(m<n){ r=m; m=n; n=r; } for(r=n;r>=2;r--){ if(m%r==0 && n%r==0) return(r); }} main() {int x,y; scanf(" 阅读全文
posted @ 2019-09-30 09:26 JackieDYH 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> struct node{ int weight; //权值 int parent; //双亲节点 int lchild,rchild; //左孩子右孩子 }; main() { struct node ht[1000]; int w[1000]; //权值 int 阅读全文
posted @ 2019-09-30 09:24 JackieDYH 阅读(3) 评论(0) 推荐(0) 编辑
摘要: //顺序结构的串 #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) 编辑
摘要: #include <stdio.h> #include <string.h> void fun(char a[]) { int b[26], i, n,max; /*数组b用于统计26个字母个数*/ for (i=0; i<26; i++) b[i] = 0; /*$ERROR$*/ n= strl 阅读全文
posted @ 2019-09-27 09:18 JackieDYH 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> void PRINT(long s) { FILE *out; printf("s=%ld\n",s); if((out=fopen("result.dat","w+"))!=NULL) { fprintf(out,"s=%ld",s); fclose(out) 阅读全文
posted @ 2019-09-27 09:17 JackieDYH 阅读(7) 评论(0) 推荐(0) 编辑