There are a pair of young rabbits, the young rabbit after one months long as a small rabbit, the rabbit after one months long as a big rabbit and gave birth to a pair of young rabbits, and the big Rabbit will give birth to a pair of young rabbits a month, ask N months after how many pairs of rabbits
Console.WriteLine ("Please enter after a few months:"); intn =Convert.ToInt32 (Console.ReadLine ()); intSYT =1, byt =0; intSXT =0, BXT =0; intSDT =0, BDT =0; for(inti =1; I <= N; i++) {byt= SDT +SXT; BXT=SYT; BDT= SDT +SXT; SYT=byt; SXT=Bxt; SDT=BDT; } Console.WriteLine ("after"+ N +"months later:"); Console.WriteLine ("The young rabbits are:"+ Byt +"the"); Console.WriteLine ("Bunny for:"+ BXT +"the"); Console.WriteLine ("The Big rabbit is:"+ BDT +"the"); intsum = byt + BXT +BDT; Console.WriteLine ("The rabbits are:"+ Sum +"the"); Console.WriteLine ("There are altogether: {0} pairs, the rabbit has {1} pairs", sum, BXT);
For Loop statement the Rabbit cub