int a = 1;
int b = 0;
int c = 0;
for (int i = 1; i <= 24; i++)
{
if (i == 1)
{
a = 1;
b = 0;
c = 0;
}
else
{
c = b + c;
b = a;
a = c;
}
Console.WriteLine("幼兔{0},小兔{1},大兔{2},总数{3}",a,b,c,(a+b+c));
时间: 2024-10-12 20:33:03