#include<stdio.h>
int main()
{
int old = 1, new1 = 0, new2 = 0, new3 = 0, year, total;
printf("please input the year.\n");
scanf_s("%d", &year);
while (year != 0)
{
while (year > 1)
{
old = old + new3;
new3 = new2;
new2 = new1;
new1 = old;
year--;
}
total = old + new1 + new2 + new3;
printf("%d\n", total);
}
return 0;
}
0.0分
0 人评分
C二级辅导-分段函数 (C语言代码)浏览:520 |
C语言程序设计教程(第三版)课后习题6.2 (C++代码)为什么回车不算字符浏览:1174 |
【绝对值排序】 (C语言代码)浏览:468 |
C语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:699 |
小九九 (C语言代码)浏览:795 |
不知道哪里错了浏览:1125 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:634 |
C语言训练-列出最简真分数序列* (C语言代码)浏览:601 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:542 |
交换Easy (C语言代码)浏览:759 |