递归法求值
Aaron_2521060899
这个作者很懒,什么都没留下…
展开
-
C语言:杨辉三角、魔方阵和递归法
#include<stdio.h> #include<assert.h> #define ROW 5 //杨辉三角 //void Fun(int (*arr)[ROW]) //{ // for(int i = 0;i < ROW;i++) // { // for(int j = 0;j <= i;j++) // { // if(i == j || j...原创 2018-11-02 13:53:35 · 572 阅读 · 0 评论 -
C语言:二分查找的递归法、将斐波那契数列改为递归版本
#include<stdio.h> //二分查找的递归法 void Search(int p[],int low,int height,int key) { int middle=(low+height)/2; if(low>height) { printf("啥都没有"); return; ...原创 2018-11-04 20:40:17 · 280 阅读 · 0 评论 -
C语言:汉诺塔(递归法)
#include<stdio.h> //汉诺塔(递归法),规定移动时不能将大环放到小环上面(从上往下为n—1) void move(char pos1,char pos2) { printf("%c==>%c\n",pos1,pos2); } void Hanno(int n,char pos1,char pos2,char pos3) { if(n == 1) { ...原创 2018-11-07 21:41:54 · 407 阅读 · 0 评论