CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - sicily1029
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - sicily1029 - List
[
Other
]
1029-Rabbit
DL : 0
中大oj(Sicily)1029的题目。这道题目主要是看清递归关系式而编即可。注意处理精度。本程序利用四位进位处理精度。-Problem The rabbits have powerful reproduction ability. One pair of adult rabbits can give birth to one pair of kid rabbits every month. And after m months, the kid rabbits can become adult rabbits. As we all know, when m=2, the sequence of the number of pairs of rabbits in each month is called Fibonacci sequence. But when m<>2, the problem seems not so simple. You job is to calculate after d months, how many pairs of the rabbits are there if there is exactly one pair of adult rabbits initially. You may assume that none of the rabbits dies in this period. Input The input may have multiple test cases. In each test case, there is one line having two integers m(1<=m<=10), d(1<=d<=100), m is the number of months after which kid rabbits can become adult rabbits, and d is the number of months after which you should calculate the number of pairs of rabbits. The input will be terminated by m=d=0. Output You must print the n
Date
: 2025-07-01
Size
: 1kb
User
:
冰淇淋
[
Other
]
sicily
DL : 0
sicily1029,sicily1134,sicily1198,sicily1211,sicily1438。-sicily1029, sicily1134, sicily1198, sicily1211, sicily1438.
Date
: 2025-07-01
Size
: 2kb
User
:
uilkruoj
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.