#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语言程序设计教程(第三版)课后习题8.6 (C++代码)浏览:699 |
The 3n + 1 problem (C语言代码)浏览:1291 |
【出圈】 (C++代码)(典型的约瑟夫环——链表解决)浏览:1168 |
C语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:3194 |
printf基础练习2 (C语言代码)浏览:913 |
Pascal三角 (C语言代码)格式错误浏览:508 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:759 |
WU-拆分位数 (C++代码)浏览:756 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:653 |
演讲大赛评分 (C语言代码)浏览:1543 |