我们定义一个序列为:第0项是1,第1项是2,之后的每项数字都是前两项数字的和再减1。
写一个函数fibo,接受一个整数 n 作为参数,返回这个序列的第 n 个数。
n
输入方式:
input()
输出方式:
print()
输入输出示例
# 输入: 0 # 输出: 1
# 输入: 2 # 输出: 2
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.
Using your Hydro universal account