P14260 [GeeksforGeeks] Print first n fibonacci numbers1002
普及-
题目描述

Given a number N, find the first N Fibonacci numbers. The first two number of the series are 1 and 1.
Example 1:
Input:
N = 5
Output: 1 1 2 3 5
Example 2:
Input:
N = 7
Output: 1 1 2 3 5 8 13
Your Task:
Your task is to complete printFibb() which takes single argument N and returns a list of first N Fibonacci numbers.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(N).
Note: This space is used to store and return the answer for printing purpose.
Constraints:
1<= N <=84

输入格式

见题面

输出格式

见题面

样例输入
N = 5
样例输出
1 1 2 3 5