已知数列:1,1,2,3,5,8,13,21,34,.求第 50 个数值,并用C#写出算法?
问题描述:
已知数列:1,1,2,3,5,8,13,21,34,.求第 50 个数值,并用C#写出算法?
答
#include int main(int argc,char * argv[]){int a =f(50);printf("The fifty number is %d\n",a);return 0;}int f(int x){ if (x==1||x==2) return 1; else ...