2.用一层循环打印99乘法口诀表

            #region 2、用一层循环打印九九乘法口诀。

            #region 方法1

            for (int i = 1; i <= 9; i++)
            {
                for (int j = 1; j <= i; j++)
                {
                    Console.Write("{0}*{1}={2}", j, i, i * j);
                }
                Console.WriteLine("");
            }
            Console.ReadLine();
            #endregion

            #region 方法2

            //for (int i = 0; i < 81; i++)
            //{
            //    int x = i % 9 + 1;
            //    int y = i / 9 + 1;
            //    if (x > y)
            //        continue;

            //    Console.Write("{0}*{1}={2} ", x, y, x * y);

            //    if (x == y)
            //        Console.WriteLine("");
            //}
            #endregion
            #endregion
原文地址:https://www.cnblogs.com/LifeForCode/p/3301453.html