11657 - Rabbit population
|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
Description
In the West, Leonardo of Pisa, a mathemetic scientists, considers the growth of an idealized (biologically unrealistic) rabbit population, assuming that:
- a single newly born pair of rabbits (one male, one female) are put in a field;
- rabbits are able to mate at the age of one month so that at the end of its second month a female can produce another pair of rabbits;
- rabbits never die and a mating pair always produces one new pair (one male, one female) every month from the second month on.
The puzzle is that: how many pairs will there be in any specific month?
You can't use loops in ths problem
You need to implement following function:
#include <stdio.h>
#include "function.h"
int Rabbit(int month)
{
// Write your code here
}
Input
The specific month N
Output
Total pairs of rabbits
Partial Judge Code
11657.c
Partial Judge Header
11657.h
Tags