程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

[Python implementation of Huawei machine test] hj37 counts the total number of rabbits per month

編輯:Python

List of articles

  • [ Cattle from Debugging entrance ](https://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395)
  • Title Description
  • Example 1
  • Reference code


Cattle from Debugging entrance

Title Description

There is a kind of rabbit , From the day after birth 3 A rabbit has been born every month since last month , The little rabbit grows to the third month and gives birth to another rabbit every month .

Example : Suppose a rabbit 3 Months was born , So it's the first 5 A rabbit will be born every month from the beginning of next month .
There was a rabbit in January , If the rabbits don't die , Ask No n What's the total number of rabbits in a month ?

Data range :
Input satisfaction 1≤n≤31

Input description :
Enter a int An integer of type denotes the th n Months

Output description :
Output the corresponding total number of Rabbits

Example 1

Input :
3

Output :
2


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved