上一页 1 2 3 4 5 6 7 8 ··· 14 下一页
摘要: 1 //斐波那契数列的递归和迭代实现 2 #include <stdio.h> 3 4 //迭代实现 5 int main() 6 { 7 int i; 8 int a[40]; 9 10 a[0] = 0; 11 a[1] = 1; 12 printf("%d %d ", a[0],a[1]); 阅读全文
posted @ 2020-08-28 17:50 wind_y 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 typedef char ElemType; 5 typedef struct QNode 6 { 7 ElemType data; 8 struct QNode *next; 9 } QNode, *Qu 阅读全文
posted @ 2020-08-28 12:40 wind_y 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 思路: 考虑括号和优先级 /* 1.如果是数字,直接打印 2.如果是右括号,弹出并打印,直到出现左括号只弹出 3.如果是+,-,栈空直接入栈,否则,依次弹出打印直到遇到左括号 4.如果是*,/,(,直接入栈。 */ /* 1.如果是数字,直接打印 2.如果是右括号,弹出并打印,直到出现左括号只弹出 阅读全文
posted @ 2020-08-27 20:41 wind_y 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 1. 2. 3. 1 //逆波兰表达式 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <ctype.h> 5 6 #define STACK_INIT_SIZE 20 //存储栈的长度,栈大小 7 #define STACKINCREME 阅读全文
posted @ 2020-08-23 23:14 wind_y 阅读(201) 评论(0) 推荐(0) 编辑
摘要: /* 1.会对它进行修改的就以指针的形式传进来,eg:void Push(sqStack *s,ElemType *e) 、void Pop(sqStack *s,ElemType *e) 2.不会修改的只需要传数据就可以了, eg:int StackLen(sqStack s) 3.指针用箭头:s 阅读全文
posted @ 2020-08-23 19:46 wind_y 阅读(229) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #define OK 1 #define ERROR 0 //可以方便的改变元素类型 typedef char ElemType; typedef int Status; typedef struct node{ int 阅读全文
posted @ 2020-08-21 22:37 wind_y 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-08-20 22:28 wind_y 阅读(110) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #define CardNumber 13 typedef struct node{ int data; struct node * next; }sqlist, *linklist; linklist CreateLin 阅读全文
posted @ 2020-08-20 21:39 wind_y 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 摘自小甲鱼 #include "stdio.h" #include <stdlib.h> #include <time.h> #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 typedef int Status;/*Status 阅读全文
posted @ 2020-08-19 11:37 wind_y 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 约瑟夫问题: #include <stdio.h> #include <stdlib.h> typedef struct node{ int data; struct node * next; }node; //创建一个有n个结点的循环链表 node * initLink(int n){ node 阅读全文
posted @ 2020-08-17 21:28 wind_y 阅读(577) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 14 下一页