zoukankan      html  css  js  c++  java
  • 数组

     // 一维数组
                // 定义方式:int [ ] 变量名 = new int [ n ];
                // 初始化:int [ ] myArray = new int [ ] {1,2,3,4,5};
                string [] weekdays = new string [] 
                    {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" };
                String s=weekdays[2];
                Console.WriteLine(s);
                Console.ReadLine();
    
                //二维数组
                //定义方式:int [,] myArray = new int [几个一维数组 , 数组中元素的个数];
                int [,] myArray = new int [4,2];
                int [,] myArray1 = new int [4,2]{{1,2},{3,4},{5,6},{7,8}};
                Console.WriteLine(myArray1[0,1]);
                Console.ReadLine();
    
                //多维数组
                int [,,] myArray2 = new int [2,4,2]
                {
                    {{1,2},{3,4},{5,6},{7,8}},
                    {{9,10},{11,12},{13,14},{15,16}}
                };
                Console.WriteLine(myArray2[0,0,1]);
                Console.ReadLine();
  • 相关阅读:
    第九周
    第八周
    第七周
    代码复审核查表
    对软件开发的理解
    第六周
    网站流量分析架构及实现
    hive的sql语句
    精简客户端搭建Oracle数据库
    idaa搭建maven发布tomcat
  • 原文地址:https://www.cnblogs.com/tonyhere/p/5480616.html
Copyright © 2011-2022 走看看