HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Chapter 3. Repetition structures > problem:


07. Fibonacci Series

Volume problems

• Flowchart 3
• Sum less than N
• Sum of N numbers
• 01. How many digits?
• 02. How many divisors?
• 04. Train
• 05. Factorial
• 06. X to the power of Y
• 07. Fibonacci Series
• 08. Binary to decimal
• 09. Decimal to binary
• 10. Maximum
• 11. Perfect numbers
• 12. Wonder primes
• 13. Round numbers
• 14. Tower of Happiness
• 2. Molecules

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

The Fibonacci series begins with 0 and 1 and has the property that each subsequent Fibonacci number is the sum of the previous two Fibonacci numbers. Some of the first Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, … Make a program to print the first N Fibonacci numbers where N is a positive integer.

Input

There is a single integer N on the first line of input (1 ≤ N ≤ 90).

Output

Print first N Fibonacci numbers

Example

stdin stdout

8

0 1 1 2 3 5 8 13

Для отправки решений необходимо выполнить вход.

www.contester.ru