二維陣列九九乘法表 


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


namespace 二維陣列九九乘法表
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] A = new int[2, 9] { { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, { 1, 2, 3, 4, 5, 6, 7, 8, 9 }};   //2=0~1(乘數跟被乘數)  9(0~9參數 )


            for (int i = 0; i <= 8; i++)
            {
                for (int j = 0; j <= 8; j++)
                {
                    Console.Write(A[0, i] + "*" + A[1, j] + "=" + A[0, i] * A[1, j] +'\t');
                }


                Console.WriteLine();    //等同Console.Write('\n');
                    
                
            }
            Console.ReadLine();
        }
    } 
}


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 yalingpixnet 的頭像
    yalingpixnet

    yalingpixnet的部落格

    yalingpixnet 發表在 痞客邦 留言(0) 人氣()