Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Fibonacci
- {
- class Program
- {
- static void Main(string[] args)
- {
- int len = int.Parse(Console.ReadLine());
- int a = 0, b = 1, c = 0;
- Console.Write("{0} {1}", a, b);
- for (int i = 2; i < len; i++)
- {
- c = a + b;
- Console.Write(" {0}", c);
- a = b;
- b = c;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement