2018jason

 1 #include <stdio.h>
 2 
 3 int main(void)
 4 {
 5     int a, b;
 6     int t;
 7     int month;
 8     int amount;
 9 
10     scanf("%d", &amount);
11 
12     a = 0;
13     b = 1;      //初始化,第一个月有一对兔子
14     month = 1;
15     while (b < amount)
16     {
17         month++;
18         t = a + b;
19         a = b;
20         b = t;
21     }
22 
23     printf("%d\n", month);
24 
25     return 0;
26 }

 

分类:

技术点:

相关文章:

  • 2022-01-02
  • 2021-06-30
  • 2022-02-08
  • 2022-02-06
  • 2022-01-06
  • 2022-01-03
  • 2021-11-18
猜你喜欢
  • 2021-12-05
  • 2021-11-19
  • 2021-12-12
  • 2022-01-17
  • 2022-02-05
  • 2021-11-20
相关资源
相似解决方案