Print a string of fibonacci recursively in C#

前端 未结 11 699
你的背包
你的背包 2020-12-29 16:05

Can that be done with no while loops?

static void Main(string[] args)
{
    Console.WriteLine(\"Please enter a number\");
    int number = Convert.ToInt32(C         


        
11条回答
  •  庸人自扰
    2020-12-29 16:21

    Using recursion in this fashion is a very bad idea. It will cause memory problems very quickly. I know you want to avoid using while/for loops, but an array is really the best way to go.

提交回复
热议问题