# 汉诺塔 hanoi # 大象放进冰箱里分机构步骤? # n = 1 (a -> c) 2^1 - 1 # n = 2 (a -> b) (a -> c) (b -> c) 2^2 - 1 # | - move 1 from a to c # | - move 2 from a to b | - ...
分类:
编程语言 时间:
2020-07-01 23:39:00
阅读次数:
58
1菲波那切数列:求第N个数列的值#include<stdio.h>
longlongFib(intn){
return(n==1||n==2)?1:Fib(n-1)+Fib(n-2);
}
intmain(){
printf("%ld\n",Fib(40));
}C:\MinGW\project>gcc-std=c99main.c
C:\MinGW\project>a.exe
102334155递归求出年龄:每一个人比前面..
分类:
其他好文 时间:
2016-05-05 07:16:04
阅读次数:
237