第十一章:for循环语句加强版

代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace for循环语句2
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int x = 1; x <= 9; x++)//控制列
            {
                for (int y = 1; y <= x; y++)
                {
                    Console.Write(y + "x" + x + "=" + y * x + " ");
                }
                Console.WriteLine();//有换行的功能
            }
            Console.Read();
        }
    }
}

运行结果:

 

posted @ 2020-06-05 18:14  进一步海阔天空  阅读(167)  评论(0编辑  收藏  举报