0 like 0 dislike
6.5k views

    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

[Exam] asked in Midterm
ID: 23785 - Available when: Unlimited - Due to: Unlimited

reshown by | 6.5k views

44 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main(){

    int input;
****** * * * ** * ** *** * * ** * *** *** ****
* * * ** * **** ** * ** * * ** * * *** int a[100];
**** * * * * ** ** ***** * * ** * ** *** * * * i;
* *** * * **** *** * * * **** *** * * * temp = 3;
* ** *** **** ** **** ***** *** ** * ** ** ** = 1;
*** ** ** *** * ** * * ** ***** * ** * *** *** = 1;
* ** * * * *** ****** * * * * ***** * *** ** *** * *
***** ** * * ** * ** * * *** * * ** ** *** ** ** *** **** * * * = a[i] + a[i-1];
* * * ***** ** * * * ** ** * ** ** *** *** ** * * * * * ** * * ** * *** *
********* ** * * * ** * * * **
**** * ** ** * *** * * * *** * * * ** * ***** * **** *

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

}
answered by (24 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>
***** ***** * ***

int main()

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

}
answered by (-368 points)
0 like 0 dislike
Hidden content!
* * * * *



int main()

{

int i,j;

long long int * * * *
* * * ** ** * *** *


** * **** ***

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

}

if(i==1 || i==2)

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

}

else
** * ** ** ** * *** ** * * * * * * *

}
answered by (-226 points)
0 like 0 dislike
Hidden content!
* * * * * **



int main()

{

int i,j;

long long int * * *
** * **** ** * **** *******


***** ** *

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

}
* * ** **** * * * * **

}
answered by (-226 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



int main()

{
** ** *** ** ** * * month,i;
* * **** * * ** **** *** ** long long int a1=0,a2=1,a3=1;


* * * *** ** ** *** * * * ** * ** * *
** * * * ***** * * (i=1; i<month-1; i++)
* ** * *** * ** ** ** *
* *** * * * * * * * **** * * * *
* * * *** * ** * * * * ** * * **** *** * ****
* ******* ** *** * * *** ** * * ** * ** ** * * *** *
** * ** * ** *** * * **
**** *** **** *** *** ** * ** * ** * * * * * **** *
* **** ** * *** * * 0;

}
answered by (-190 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>
* * ***** * * * *

int main()

{
* * * ** * ** *** ** i,j,n;
** * * *** * ** * long a[100];
* * ******* ** *** * * * * * *** * ***
* *** ** * *** * *** * ***** && n<=90){
* ** * * ** * * * ** ** *
* * * ** ***** * **** * ** ***
***** * ******* ***** * * ** * *****
*** * * *** *** * ** * ** **** ** * * * * *** * * **
* ** * * ** *
* ** *** ** ****** * * **** ** ****** *
******* **** ** ** *
** **** * ** * ** ** * 0;

}
answered by (-384 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>
*** *** * * **

int main()

{
**** ** * ***** **** ** ** * i,j,n;
** * * ** * ** ** ** ** * ** long a[90];
*** *** ***** *** **** ** ***** * *
** ** * ** * * * && n<=90){
** **** **** ********* ** **
* * *** ** ** * * * ***
** * * **** ** ** ** ** * * *
** * ** ** * ***** ** * * * * ** * **** *
*** *** ** * **** ** ****
*** * **** *** *** * *** * * * ****** **
* * * * * *** **


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

}
answered by (-384 points)
0 like 0 dislike
Hidden content!
#include * * * ** *

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



int main()

{
* * *** ***** ** **** ** long long f[91];
**** ** *** * *** * i, n;
*** * **** * * * * = f[2] = 1;


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


* * * * *** *** *** ** i++)
* * ****** ** * ** * ** * ***** * * ** * *** * * ** = f[i-1] + f[i-2];


* * ** * *** ** ** **** * ***** f[n]);


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

}
answered by (5.2k points)
0 like 0 dislike
Hidden content!
#include <stdio.h>







long long int rabbit(int n)



{


**** * *** **** ** ** * * **** long int value1, value2, value3;


* ** * *** * ** ********* count = 1;


*** * **** * * * ** ** * = 0;


**** ** * * ** *** = 1;


* ** * **** * * (n == 2)


* * *** ** ** ** ****** *** *** * ** ** 1;


* * *** ** * ** **** * if (n == 1)


*** * * **************** * * * ** **** ** **** * * 1;


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


* ****** * * * * *** * ** * **** ** *** (count < n)


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


** ** * **** ** *** ** ** *** * * ** * * ** * ** ** ** = value1 + value2;


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


* ***** * * * * *** ** * * ** ** * *** * * * * *** ** * * *** * = value2;


* ** *** * ** ** ** ** ** *** * ** * **** * * ***** **** * * *** = value3;


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


* * ** * ** ** * * * ***** * * ** ** * * * * value3;



}



int main()



{


* ** ** * * ** **** * num;


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


* * * **** * * ** * ** * * * * * **** ** **** rabbit(num));


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



}
answered by (237 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>



long long int rabbit(int n)

{
* ****** * *** * * ** *** *** ** long int value1, value2, value3;
***** * ** ** count = 1;
* ** ** ** * ** ** * = 0;
* *** * * * *** * = 1;

    if (n == 2)
** * * ** * ** ** * *** **** * * * * **** 1;
*** ******* ** *** * if (n == 1)
* *** *** * **** * * * ******* **** * *** ** * 1;
** ** * *** **** * *
* **** ** * * * *** * * * ******* ***** * * (count < n)
** * ** * *** ** ** ** * ***** * * ** ** *
*** * * ** * * * * ** ** * ** *** * ***** * * *** * **** * * = value1 + value2;
**** **** ** * * * * * ** *** * ** * * * * * ** *
** * *** * ****** * * *** * ** ** *** * * * * * * * = value2;
* ** ** ****** ** ***** * * ** ** **** * * *** * * * * * **** ** * = value3;
* * *** **** ******* *** * * ** *** ***
* * *** ** * ** *** * * * * * * *** ** * value3;

}

int main()

{
** ** * *** * ** ** * *** num;
*** ** ** * * ** * * * * ** * &num);
*** * **** ** * * ** ** **** * * *** rabbit(num));
** * * **** * * * * * *** * * * 0;

}
answered by (126 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.159.115.31
©2016-2026

Related questions

0 like 0 dislike
13 answers
[Exam] asked Apr 21, 2017 in Midterm
ID: 24269 - Available when: Unlimited - Due to: Unlimited
| 2.5k views
0 like 0 dislike
8 answers
[Exam] asked Apr 21, 2017 in Midterm
ID: 24273 - Available when: Unlimited - Due to: Unlimited
| 1.8k views
0 like 0 dislike
6 answers
[Normal] asked Apr 21, 2017 in Midterm by thopd (12.1k points)
ID: 24271 - Available when: Unlimited - Due to: Unlimited
| 1.6k views
0 like 0 dislike
70 answers
[Exam] asked Apr 13, 2017 in Midterm
ID: 23789 - Available when: Unlimited - Due to: Unlimited
| 9.4k views
0 like 0 dislike
46 answers
asked Apr 13, 2017 in Midterm by thopd (12.1k points) | 6.4k views
12,783 questions
183,442 answers
172,219 comments
4,824 users