FIBONACCI ARRAY

View as PDF

Submit solution

Points: 0.10
Time limit: 1.5s
Memory limit: 64M
Input: stdin
Output: stdout

Authors:
Problem type
Mô tả vấn đề

Dãy fibonaci là dãy số như sau:

f[1] = f[2] = 1

f[i] = f[i-1] + f[i-2] (i >= 3)

Bạn hãy viết chương trình thực hiện các yêu cầu sau:

  • Sử dụng mảng A, lưu n giá trị đầu tiên của dãy Fibonacci.
  • In n giá trị đầu tiên của dãy Fibonacci ra màn hình.

Input

Nhập số nguyên n (n ≤ 40)

Output

Xuất mảng A. Mỗi phần tử in trên một dòng

Sample Input 1
5
Sample Output 1
1 
1 
2
3
5

Comments

Please read the guidelines before commenting.


There are no comments at the moment.