Advertisement
SamuilPetrow

Console Input/Output - Task 10

Mar 14th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ConsoleInputOutput
  4. {
  5.     public static class Fibonachi
  6.     {
  7.         public static void Main()
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             ulong first = 0;
  11.             ulong second = 1;
  12.             Console.WriteLine(first);
  13.             Console.WriteLine(second);
  14.             ulong third = ulong.MinValue;
  15.             for (int i = 2; i < n; i++)
  16.             {
  17.                 third = first + second;
  18.                 Console.Write(third + " ");
  19.                 first = second;
  20.                 second = third;
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement