#P0029. fibo函数

fibo函数

1. Description

Let's define a sequence of integers:

  • The 0-th item is 1, the 1-st element is 2
  • For any of the following item, it equals t o sum of previous two elements and then minus 1
1,2,2,3,4,6,9,14,22,...1, 2, 2, 3, 4, 6, 9, 14, 22, ...

Code a function fibo, which takes an integer n as input and returns the n-th item of this sequence

2. Input & Output

Input:

  • An integer
  • Use input() as input. Notice that the value you get from input() is a string

Output:

  • An integer
  • Use print() for your output

Example

# Input: 
0
# Output: 
1
# Input: 
2
# Output: 
2