1 Star 0 Fork 0

zhuoxue/代码学习的路途

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tuzi.c 375 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhuoxue 提交于 2022-10-09 21:45 +08:00 . WEEK6
#include<stdio.h>
int tuzi(int n);
int main(){
int n;
scanf("%d", &n);
int month = tuzi(n);
printf("%d", month);
return 0;
}
int tuzi(int n){
int startcouple = 0;
int endcouple = 0;
int children1 = 1;
int month = 1;
while(endcouple + children1 < n){
month ++;
endcouple += children1;
children1 = startcouple;
startcouple = endcouple;
}
return month;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Joci-zhuoxue/the-way-of-code-learning.git
git@gitee.com:Joci-zhuoxue/the-way-of-code-learning.git
Joci-zhuoxue
the-way-of-code-learning
代码学习的路途
main

搜索帮助