Console.WriteLine("请输入经过了几个年:");
int n = Convert.ToInt32(Console.ReadLine());
int syt = 1, byt = 0;
int sxt = 0, bxt = 0;
int sdt = 0, bdt = 0;
for (int i = 1; i <= n; i++)
{
byt = sdt + sxt;
bxt = syt;
bdt = sdt + sxt;
syt = byt; sxt = bxt; sdt = bdt;
}
Console.WriteLine("经过" + n + "个年后:");
Console.WriteLine("幼兔为:" + byt + "对");
Console.WriteLine("小兔为:" + bxt + "对");
Console.WriteLine("大兔为:" + bdt + "对");
int sum = byt + bxt + bdt;
Console.WriteLine("兔子总共有:" + sum + "对");
Console.WriteLine("兔子总共有:{0}对,小兔子有{1}对", sum, bxt);