dadan


私信TA

用户名:dadan

访问量:9462

签 名:

幸福都是奋斗来的

等  级
排  名 5050
经  验 1574
参赛次数 0
文章发表 16
年  龄 0
在职情况 学生
学  校 南京航空航天大学
专  业

  自我简介:

参考代码:

int n;
float child = 2.0, mother = 1.0;
float sum;
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
   sum += child / mother;
   int temp = child;
   child += mother;
   mother = temp;
}
printf("%.2f",sum);
return 0;

 

0.0分

0 人评分

  评论区

  • «
  • »