C#打印中的占位符

代码实例 

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

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            int iRow, iColumn;//定义行数和列数
            for (iRow = 1; iRow < 10; iRow++)
            {
                for (iColumn = 1; iColumn <= iRow; iColumn++)//列数循环
                {
                    //输出每一行的数据
                    Console.Write("{0}*{1}={2} ", iColumn, iRow, iRow * iColumn); //占位符
                }
                Console.WriteLine();//换行
            }
            Console.ReadLine();
        }
    }
}

猜你喜欢

转载自blog.csdn.net/weixin_42274148/article/details/89703708
今日推荐