sobota, grudnia 04, 2010

Program w C#

Ciąg Fibonacciego C#  :

            uint a = 1;
            uint b = 1;
            uint c = 0;
            Console.WriteLine("Podaj dowolną liczbe n:");
            uint n;
            n = uint.Parse(Console.ReadLine());
            if (n > 1)
            {
                for (int i = 0; i < n - 1; i++)
                {
                    c = a + b;
                    a = b;
                    b = c;
                }
                Console.Write("wynik to : ");
                Console.Write(b);
                Console.ReadKey();
            }
            else
            {
                Console.WriteLine(" Nie ma sensu liczyc dla n<=1");
                Console.ReadKey();      

1 komentarz:

  1. Wynn Slots for Android and iOS - Wooricasinos
    A free app for wooricasinos.info slot machines from WRI Holdings Limited that lets 출장샵 you play the kadangpintar popular games, such as free video slots, table games and live casino 출장마사지

    OdpowiedzUsuń

Szukaj na tym blogu