0 喜歡 0 不喜歡
5.5k 瀏覽

    Suppose there is a pair of newborn bunnies in the pasture in the first month, each pair of male and female bunnies grew into a large male and female rabbits after two months later. After three months from the start, each pair of male and female rabbit can give birth to a pair of small bunnies every month. If the rabbits can live forever, how many pair of rabbits in the pasture in the first N month?

(1<=N<=90)(Very IMPORTANT)

Input

3

Output

2

 

Input

5

Output

5

 

Input

88

Output

1100087778366101931

[考試] 最新提問 分類:Midterm |
ID: 23785 - 從幾時開始: 無限制 - 到幾時結束: 無限制

重新顯示 用戶: | 5.5k 瀏覽

44 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>



int main()

{
* ** ** ** ***** * * i, num;
* * ** ** * * ****** * ** long total = 0, rabbit = 1, pairs = 1;


**** * * ** * ** * ** * ** * &num);


* ****** *** * ** ** * * = 2; i < num; i++)
* * * *** * *


* ** **** *** * ** * * ** * ***** ** *** *** *** = rabbit + pairs;
** * ** ** ** * ** ** *** ** * * * * * * = rabbit;
** * ** * * * * * **** ** *** * * *** = total;


* *** **** ** *****
* * **** * * ***** * **** * *** * == 0)
* *** * ****** * * * *
* ** * *** * * * *** * ** * ******* * *** ** * ** ** ***
* * * * * * **** * else if(num == 1)
* ** * * ** ****
* ** * ** ** **** * ** * * * ** * **** * * * *** * ** **
***** **** *** *** ** *** else if(num == 2)
* * * ** **** *********
** ** **** * **** * ** ** ** **** ******* * * * * ****** *
* **** ** ** ** * *** * else{
* ** * * ** * *** * * *** * ** **** ** *** ** ** * *** * * **

    }




**** *** * * ****** * ** 0;

}
最新回答 用戶: (20 分)
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

#include<string.h>



int main()

{
** * *** *** * ** ** * * * * * *** ** ****** ** ** bun10[91][10];
* ** ** * ** * i, n;
* * ** * **** **** * * * *
* * * * * ** * *** * * *** ** * * * ******* ** * ** *** *** ****** ****
** ** ** **** * ** * **
* ** * *** * * ** *** * * * * * &n);
* **** * ** * * * * * ** ** * * * * bun[n-1]);
*** * * * ** * * ** *** * 0;

}
最新回答 用戶: (-368 分)
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
** ** ***** ******

int main(void)

{
** ** * *** * ** * * ** long bun[91]={1,1};
* *** * *** ** **** i, n;
* ** * ** * **** ****** **** **
*** *** *** * * ***** *** ** ******* ** **
* ****** * * * *** *
* ** * * ** ** ** *** * * * ***** * *** ** * &n);
************ * * * *** ** * *** ***** bun[n-1]);
** * *** * * * * * * 0;

}
最新回答 用戶: (-368 分)
0 喜歡 0 不喜歡
內容已隱藏
#include ** ******



int main(){

long long int f[90];

int i;

int n;

long long int b;

for **** * * ***
** *** * * ** *** *** * **
*** ****** ** * * *** ****
** ** ** **** ***** ** * if(i==1)
* ** * * * * *** * * * **
* * ****** * * * ** **
* * * * ** **** * **** * * *
***** ** * * ******* * ** * * * * *

}


** * * ** **** ** *


** ** ** ** *** * * ***


** ** *


**** *** *** * * *

}

return 0;}
最新回答 用戶: (-34 分)
0 喜歡 0 不喜歡
內容已隱藏
#include * *** * * *

#include ** * ** **





int main ()

{
***** * * * * ***** * ** long unsigned int N[100] = [0];
*** ***** ** * *** ** * * m, i;


* ** * * *** * * * * ******** * ** **
* * ** * ** ** ** ** = 2;
* **** ** * *** ** ** **** * = 2;
** *** *** *** * * = 2;
** * *** * * *** * *** * = 2;


* * ** * * * *** ** * * * (i=4; *** *** i++)
** * * * * ** ** * * * **** ** ** *** *** N[i-1] + N[1-2];


* * * *** * * ** * ***** * N[m-1]);


* * * * ** ****** ***** *** ** 0;



}
最新回答 用戶: (-48 分)
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

#include<stdlib.h>

int main(void)

{
* ***** * **** **** * * * num,i;
*** * * * *** ** *** * *** long long int a[90]={0},b=0;


** * ** ** * * ***** **** *** * ****** * *
* * *** * * * *** * *** ****
* ***** * ** ** * *** *
* *** * * * * * * ** * * ** ** *
***** ** * * ** **** * *
* * * * * * ** *** * ** ******* ** * **** ** *
** ** * * * ****
***** * ** * *** **** * * ** ** * ** *** * *
* * * *** * * *** ** * ***** 0;

}
最新回答 用戶: (-412 分)
0 喜歡 0 不喜歡
內容已隱藏
#include * **** ** **

#include ** ** ** **

#include * * * *** ***

int main(){
* ** **** b,d,i;
**** * long int * ** *
* * * * *** s[90];
***** ***** * * * ** ** * ***
* * *** (b==1 || b==2)

{
** *** * * * ** * *
* * *** ** {
*** * * **** * * * *
*** ** * ** * **
* ** * *** *** * * * *
*** *** * **** *** ****
* ** *
* ** *** **** *** ** *

}
** ***
** *** * return 0;

}
最新回答 用戶: (-136 分)
0 喜歡 0 不喜歡
內容已隱藏
#include * * * *

#include * * ** * ***

#include ***** * *** *

int main(){
***** * b,d,i;
** * * long int a,c,y=1,z=1;
* *** **** ** ** s[90];
** **** * * *** * ** **
** *** * (b==1 || b==2)

{
* ***** * *** * * * ** * *
**** * {

 
* * ***
* * ** * * * ** **
*** * * * * * * **
* * * * * * *** * ** *
** ** * * **** *** ** *

 }

}
* * ** * * * * * *
** * * * ** ** * * * ** * 0;

}
最新回答 用戶: (-136 分)
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

#include<stdlib.h>

#include<math.h>  



int main()

{
* **** * * **** ** * time;
* * *** ** ** * long i,j,F0,F1=1,F2=0,sum;
* ** *** ****** ** ** * **** ** ** * * * * *****
*** * * ** ** **** * ** ***** i<time; i++)
* *** *** * * * **** * **
*** **** * ** * ** ** * * * * * ** ***** ** **
* ** **** * ** ***** * * * * ** * ** * *** **
* ****** ** * * * *** ** ** * * * * ***** *
** * ** * **** ** *** * **** * *** *******
* ** ****** ** ** *** *
* * * ** * ***** * * * * * * *** * ***
* * ** * *** *** *** * *** * 0;

}
最新回答 用戶: (-264 分)
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

#include<stdlib.h>

int main(void)

{
* ** * * * ** * num,i;
*** * *** ******** ***** * * *** long long int a[90]={0},b=0;


** ** **** * * * ***** ***** * ** * **
* * * ** * ** * ** ****
*** * **** ****** * *** *
* * * **** ** * * * * * * * ** *
* ** * ** * **
**** * ** ** * * ** **** ** *** * *** ** *
** * * * ** ** ****** * ** * * * * * ** ** ****
**** * * * * ** * *
*** * * * * * * ** *** ** * * *** * *
***** * * * * * ** * ** 0;

}
最新回答 用戶: (-412 分)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.50.26
©2016-2025

相關問題

0 喜歡 0 不喜歡
13 回答
[考試] 最新提問 4月 21, 2017 分類:Midterm |
ID: 24269 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 2.1k 瀏覽
0 喜歡 0 不喜歡
8 回答
[考試] 最新提問 4月 21, 2017 分類:Midterm |
ID: 24273 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 1.5k 瀏覽
0 喜歡 0 不喜歡
6 回答
[正常] 最新提問 4月 21, 2017 分類:Midterm | 用戶: thopd (12.1k 分)
ID: 24271 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 1.3k 瀏覽
0 喜歡 0 不喜歡
70 回答
[考試] 最新提問 4月 13, 2017 分類:Midterm |
ID: 23789 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 8.1k 瀏覽
0 喜歡 0 不喜歡
46 回答
最新提問 4月 13, 2017 分類:Midterm | 用戶: thopd (12.1k 分) | 5.4k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶