第1个回答 2020-06-03
#include <stdio.h>
#define N 10 //预设一个值,也可以用scanf函数输入一个数
int main()
{
/* 我的第一个 C 程序 */
int moth,num;
int fst,sec,thd,m;
moth = 0;
fst = 0;
sec = 0;
thd = 1;
num = N;
while((fst+sec+thd)<num)
{
moth++;
m=fst;
fst=thd;
thd+=sec;
sec=m;
}
printf("%d \n",moth);
return 0;
}