摘要: #include <stdio.h> #include <stdlib.h> /* * 给出RNL,RLN,NRL是为了,有更多解决问题的方法 */ typedef struct node { char data; struct node *lchild,*rchild; }*BitTree,Bit 阅读全文
posted @ 2021-03-31 17:48 nanfengnan 阅读(123) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> /* * 给出RNL,RLN,NRL是为了,有更多解决问题的方法 */ typedef struct node { char data; struct node *lchild,*rchild; }*BitTree,Bit 阅读全文
posted @ 2021-03-31 17:30 nanfengnan 阅读(72) 评论(0) 推荐(0)
摘要: #include <stdio.h> //兔子繁殖问题 /* * 问题描述: * 有一对小兔子,从出生起第3个月起每个月都生一对小兔子. * 小兔子长到三个月后每个月又生一对兔子,按此规律,设第一个月有一对刚出生的兔子, * 问第n个月后有多少对兔子. * * 1.分析 * 第一个月-第10个月: 阅读全文
posted @ 2021-03-31 11:48 nanfengnan 阅读(982) 评论(0) 推荐(0)
摘要: #include <stdio.h> //斐波那契数列的非递归实现 int f(int n) { int a,b,sum; sum=0; a=1;b=1; if (n==1||n==2) return 1; for (int i = 2; i < n; ++i) { sum=a+b; a=b; b= 阅读全文
posted @ 2021-03-31 11:25 nanfengnan 阅读(407) 评论(0) 推荐(0)