09.11 小兔 成兔问题

 Console.Write("请输入月份:");
            int yue = int.Parse(Console.ReadLine());
            int yt =1;
            int xt=0;
            int ct =0;
            int zt=1;
            for (int i = 1; i <= yue; i++)
            {
                if (i == 1)
                {
                    yt = 1;
                    xt = 0;
                    ct = 0;
                    zt = 1;
                }

                else
                {

             ct = xt + ct;

                    xt = yt;
                    yt = ct;
                    
                }
            }Console.Write("幼兔="+yt);
                    Console.Write("小兔="+xt);
                    Console.Write("成兔"+ct);
            zt = yt+xt + ct;


            Console.Write("总兔" + zt);
            Console.ReadLine();

原文地址:https://www.cnblogs.com/cf924823/p/4804850.html