【C#学習ノート】配列使用

1878 ワード

using System;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            //int[] a=new int[3];    //    
            int[,] a = new int[3,3];
            for (int i = 0; i < 3;i++ )
            {
                for (int j = 0; j < 3;j++ )
                {
                    a[i,j] = i + j;
                    Console.Write(a[i, j]);
                    Console.Write("  ");
                }
                Console.WriteLine();
            }
            Console.Read();
        }
    }
}

 
転載先:https://www.cnblogs.com/tiandsp/p/7440401.html