#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语言代码)浏览:1346 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:608 |
【出圈】 (C语言代码)浏览:749 |
大神老白 (C语言代码)浏览:551 |
A+B for Input-Output Practice (V) (C语言代码)浏览:572 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:888 |
C语言程序设计教程(第三版)课后习题8.7 (C语言代码)浏览:556 |
母牛的故事 (C语言代码)浏览:507 |
1012题解浏览:735 |
字符逆序 (C语言代码)浏览:577 |