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();
时间: 2024-10-05 05:02:26