斐波那契数列是一个自然数序列,定义如下:
- $F_1 = 1$;
- $F_2 = 1$;以及
- $F_n = F_{n-1} + F_{n-2}$,对于 $n > 2$。
编写一个程序,输出斐波那契数列的前 5 个数。
输入格式
本题没有输入。
输出格式
输出 5 个整数,表示斐波那契数列的前 5 个数。输出中任意两个相邻的数字之间用一个空格隔开,行末不包含多余的空格或符号。
样例
输入 1
(no input)
输出 1
1 1 2 3 5
斐波那契数列是一个自然数序列,定义如下:
编写一个程序,输出斐波那契数列的前 5 个数。
本题没有输入。
输出 5 个整数,表示斐波那契数列的前 5 个数。输出中任意两个相邻的数字之间用一个空格隔开,行末不包含多余的空格或符号。
(no input)
1 1 2 3 5
The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.
This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.
If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.
Guidelines: