递归

    class Program
    {
        static void Main(string[] args)
        {
            Test(0); 
            Console.ReadKey();
        } 

        static void Test(int i)
        {
            i++;
            Console.WriteLine(i);
            if (i < 5)
            {
                Test(i);
            }
        
        }


    }

  

原文地址:https://www.cnblogs.com/sumg/p/3754080.html