#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语言代码)浏览:1055 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:1232 |
printf基础练习2 (C语言代码)浏览:644 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:682 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:608 |
1017题解浏览:571 |
简单的a+b (C语言代码)浏览:543 |
震宇大神的杀毒软件 (C语言代码)浏览:1078 |
图形输出 (C语言代码)浏览:933 |
小O的乘积 (C语言代码)浏览:1006 |