#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 人评分
Tom数 (C语言代码)浏览:2043 |
字符串的输入输出处理 (C语言代码)浏览:691 |
点我有惊喜!你懂得!浏览:4126 |
【出圈】 (C语言代码)浏览:812 |
【偶数求和】 (C语言代码)浏览:662 |
C语言训练-计算t=1+1/2+1/3+...+1/n (C语言代码)浏览:921 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:636 |
用筛法求之N内的素数。 (C语言代码)浏览:699 |
1054题解浏览:489 |
数组与指针的问题浏览:740 |