01 c# 数组

 class Program
    {
        static void Main(string[] args)
        {

            /* C#  基础语法,【数组】的使用及理解
             * 数组长度必须固定
             * 数组的索引从0开始
             * 
             */

            string name = "制定项目章程";
            string[] nams = new string[] {"制定项目管理计划","指导与管理项目管理","管理项目知识" };
            Console.WriteLine($"{nams[0]}");
            int[] ints = new int[2];
            // 赋值
            ints[0] = 1;
            ints[1] = 2;
            // 取值
            Console.WriteLine($"{ints[0]}");


            Console.WriteLine("Hello World!");
        }
    }

  

猜你喜欢

转载自www.cnblogs.com/hnzheng/p/12684526.html