方法2:include <stdlib.h> #include <stdio.h> int Fibon1(int n){if (n == 1 || n == 2){return 1;}else{return Fibon1(n - 1) + Fibon1(n - 2);}} int main(){int n = 0;int m=0;int ret = 0;printf("请输入要计算的斐波那契数列的前N项总数:");scanf("%d",...
int main(){ double e=1,t=1;int i,n;scanf("%d",&n);for(i=1; i<=n; i++){t/=i;e+=t;} printf("%f\n",e);return 0;}
int main(){ double e=1,t=1;int i,n;scanf("%d",&n);for(i=1; i<=n; i++){t/=i;e+=t;} printf("%f\n",e);return 0;}