#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语言代码)浏览:525 |
C语言考试练习题_一元二次方程 (C语言代码)浏览:689 |
C语言训练-求s=a+aa+aaa+aaaa+aa...a的值 (C语言代码)浏览:975 |
C语言训练-素数问题 (C语言代码)浏览:924 |
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:1329 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:652 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:502 |
WU-输出九九乘法表 (C++代码)浏览:1603 |
C语言考试练习题_保留字母 (C语言代码)浏览:665 |
K-进制数 (C语言描述,蓝桥杯)浏览:901 |