0 like 0 dislike
9.3k 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

[Exercise] Coding (C) - asked in C
ID: 22018 - Available when: Unlimited - Due to: Unlimited

edited by | 9.3k views

69 Answers

0 like 0 dislike
Hidden content!
** * * ** *
* * * * **** **



int main()

{
** **** * ** * ***** long int num[100] = { 0 }, n;
* * * ** * ** ***** * i;


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


** ** ** **** ***** * ** ( i = 2; i <= n; i++)
* *** ** * *** * *
* ** **** *** *** ** ** * * ** ** ***** ** * ** = num[i - 1] + num[i - 2];
* * ** ******** *
*** *** * ** ** * * * ** * ** num[i - 1]);


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

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

#include<stdlib.h>

int main(void)

{
** * * ** *** * * * * n,i;
* * *** * *************** long num[100];


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


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

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



int main(void){


* **** * * * * * ** * *** num, i;


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


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


* ** * * * * ** * * long N[num];
* * * * *** ** * **
** * ** * * * *** ******


* *** * * * * **** ** i<num; i++){
* * ** *** * * ** *** ** * * * ** *** * *** * *
**** **** ******* ** ** * *


* ** * * * * * * ***
* * *** * *** * ** **** * * * N[i]);


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

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

long ** ** * *** *

{
* **** return 1;
* ** *** * * *** *

}

void main()

{
***** ** long n;
** ** ***** ** ** * * * *** ** * **
* * ** ***** ** * ***** * *** *

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

int fibo(int);



int main()

{
* * * ** * ** * * num, result;
* * ** * *** ** **** ** * * ** * * &num);
* ** * ** *** ** * *** **** (num < 1 || num > 90)
*** * * *** * * * * ** *** * **** * * * *** * * **
****** * ***** ** * *
**** * * * ** * *** *** ** * * ******* *** = fibo(num);
* *** * * ****** **** ** * * ***** **** * * ** * ***** result);
** *** * *** * * * ** *
* ***** ** * * **** **** * 0;

}



int fibo(int num)

{
* ** **** * ** (num == 0)
*** * * * **** * * * * ** * ** ** *** ** 0;
** * * ** ***** ***** if (num == 1)
*** * ******* ** * * * * * * * * *** ****** 1;
**** ** *** * * *** **** *
*** * ** **** * * ** ****** ** ** * **** ** * * - 1) + fibo(num - 2));

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

#include<stdlib.h>

int main()

{
** * *** ** * *** * * * * n,stop;
* * * * * *** * **** ** * long a[100];
* **** * * *** *** ** *** **** * ** ** * ** *
* ** ** * *** * * * * **** **
* * **** **** ***** ** * ** * ***** *
** * ** * ** *****
** ** ** * * * * **** * ****** ** ***** ** *** *
* ** * * * ** *** *
** * ** ** ** * ** ** * ** ** ** * ** * ** * *
* * * * *** * *
* * * * **** **** ** * *** 0;

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



int main(void){


* * ** * ** * ** ** ** ** num, i;


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


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


** * **** * ** * * ********** N[num];
* * * * * * ** *** ***
*** * * ** * ** * *


* ** *** * ** * * * ** i<num; i++){
* ** * * * * * * * ** ** ** *** *** * ** *** * ** * * * ****
* ** * * * * **


* * * * * * ** * ***
** ** *** ** *** * * * * *** ** ** * ** N[i]);


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

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



int main(void){


* * * ** * * * * * * num, i;


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


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


* ** ** * ** ** ** * * long N[num];
** * ** * * *** ******* * ***
*** *** *** *** *****


* **** *** * * ** * *** i<num; i++){
* **** ******* * * * ** * * ** ** * *** ** * *
*** ** * ****** *


** ***** * *** *** * * * ***
** * * **** * * ** * * * *** ** * * * * N[i]);


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

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



int main(void){


** *** **** * * ******** num, i;


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


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


** ** ** * * * ** long N[num];
***** ***** **** ** *
* * **** *** * *** ** *


* ** *** * * **** * *** * i<num; i++){
* * ***** ** * ** * ***** ** * * * ** *** * ** *** *
* * * * *** * * ** * *** ******* * * ***** ***** * * ** ** ***** N[i-1], N[i-2]);
* ** * ** ** ** **** * * ** ** **** ****** * *** *** * * i, N[i]);
*** *** *** ** *** **** *


* ***** ** ** **** * ** * **
****** * * ** **** * * * * *** ** ** * * ** N[i]);


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

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

Related questions

0 like 0 dislike
23 answers
[Exercise] Essay (Open question) - asked Mar 23, 2017 in C
ID: 23262 - Available when: Unlimited - Due to: Unlimited
| 4.4k views
0 like 0 dislike
52 answers
[Exercise] Coding (C) - asked Feb 23, 2017 in C
ID: 22017 - Available when: Unlimited - Due to: Unlimited
| 7.1k views
12,783 questions
183,442 answers
172,219 comments
4,824 users