摘要: # include # include struct BTNode { int data; struct BTNode * pLchild; // p 是指针 L 是左 child 是孩子 struct BTNode * pRchild; // 表示右孩子 }; struct BTNode * CreateBTree(void); //静态创建二叉树 vo... 阅读全文
posted @ 2019-04-06 14:21 LXL_1 阅读(176) 评论(0) 推荐(0) 编辑
摘要: # include int g(int); int f(int); int f(int n) { if (n int f(int n) { n += 2; return n; } int main(void) { int val; val = f(5); return 0; } 阅读全文
posted @ 2019-04-06 14:20 LXL_1 阅读(188) 评论(0) 推荐(0) 编辑
摘要: # include long sum(int n) { //用递归实现: if (n == 1) return 1; else return sum(n-1) + n; /* 用for循环实现: long s = 0; int i; for (i=q; i<... 阅读全文
posted @ 2019-04-06 14:19 LXL_1 阅读(526) 评论(0) 推荐(0) 编辑
摘要: # include int main(void) { int val; printf("请输入一个数字:"); printf("val = "); scanf("%d", &val); for (i=1; i<=val; ++i) { mult = mult * i; } printf("%d... 阅读全文
posted @ 2019-04-06 14:18 LXL_1 阅读(245) 评论(0) 推荐(0) 编辑
摘要: # include int main(void) { int val; printf("请输入一个数字:"); printf("val = "); scanf("%d", &val); for (i=1; i<=val; ++i) { mult = mult * i; } printf("%d... 阅读全文
posted @ 2019-04-06 14:17 LXL_1 阅读(334) 评论(0) 推荐(0) 编辑
摘要: # include void f(int n) { if (n == 1) printf("哈哈\n"); else f(n-i); } int main(void) { f(3); return 0; } 阅读全文
posted @ 2019-04-06 14:16 LXL_1 阅读(205) 评论(0) 推荐(0) 编辑
摘要: # include # include typedef struct Queue { int * pBase; int front; int rear; }QUEUE; void init(QUEUE *); //初始化 bool en_queue(QUEUE *, int val); //入队 void traverse_queue(QUEUE *); //遍历... 阅读全文
posted @ 2019-04-06 14:15 LXL_1 阅读(160) 评论(0) 推荐(0) 编辑
摘要: # include void f(); void g(); void k(); void f() { printf("FFFF\n"); g(); printf("1111\n"); } void g() { printf("GGGG\n"); k(); printf("2222\n"); } void k() { printf(... 阅读全文
posted @ 2019-04-06 14:15 LXL_1 阅读(130) 评论(0) 推荐(0) 编辑
摘要: # include # include # include typedef struct Node //建造节点 { int data; struct Node * pNext; }NODE, * PNODE; typedef struct Stack //建造栈所需要的两个参数 { PNODE pTop; //指向栈顶的元素 PNODE pBottom... 阅读全文
posted @ 2019-04-06 14:14 LXL_1 阅读(191) 评论(0) 推荐(0) 编辑
摘要: # include # include # include //函数声明 PNODE create_list(void); //创建链表 void traverse_list(PNODE pHead); //输出链表 bool is_empty(PNODE pHead); //判断链表是否为空 int length_list(PNODE); //求连链表的长度 bool insert_l... 阅读全文
posted @ 2019-04-06 14:13 LXL_1 阅读(155) 评论(0) 推荐(0) 编辑