11657 - Rabbit population   

Description

In the West, Leonardo of Pisa, a mathemetic scientists, considers the growth of an idealized (biologically unrealistic) rabbit population, assuming that:

  1. a single newly born pair of rabbits (one male, one female) are put in a field;
  2. 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;
  3. 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 

Sample Input  Download

Sample Output  Download

Partial Judge Code

11657.c

Partial Judge Header

11657.h

Tags




Discuss