Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FibonacciNumbers
- {
- static void Main()
- {
- ulong n = ulong.Parse(Console.ReadLine());
- ulong f1 = 0, f2 = 1;
- for (ulong i = 0; i < n; i++)
- {
- if (f1 < f2)
- {
- Console.Write(f1 + " ");
- f1 += f2;
- }
- else
- {
- Console.Write(f2 + " ");
- f2 += f1;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement