All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
实例详细讲解PHP连接调用数据库的方法_php资料_编程技术
SQL中的五种数据类型_[SQL,Server教程]
C#教程:Windows服务概述
Asp.Net,Ajax,学习笔记6,客户端访问WebService(上)_[Asp.Net教程]
最简单快速的Apache二级域名实现方法介绍_[PHP教程]
C#中ErrorProvider组件应用实例
十八 链接的可用性_[Html教程]
实例了解Asp.Net的继承和多态性_[Asp.Net教程]
Asp.net
Windows下Apache+Tomcat+MySQL+jsp+php的服务器整合配置经验总结_php资料_编程技术
Reading number is top 10 pictures
Summer is most suitable for young people to travel in China5
China's family planning commission forced abortions 270 million newborns for 30 years
From China fortress sora aoi1
西游四格漫画(二)
做运动的校花1
Chinese paper-cut grilles art appreciation8
西游日记1
Sora aoi on twitter4
The hot big eye big breast beauty3
Chinese paper-cut grilles art appreciation2
Download software ranking
Boxer vs Yellow3
Tram sex maniac 2 (H) rar bag5
c#程序设计案例教程
Unix video tutorial17
Unix video tutorial12
中国结婚习俗实录
Kung.Fu.Panda.2
电车之狼R
传奇私服架设教程-chm
The cock of the Grosvenor LTD handsome
qq published in(发表于) 2014/7/11 9:19:22 Edit(编辑)
C#中多维数组的使用

C#中多维数组的使用

C#中多维数组的使用

C#中多维数组的使用

在多维数组中,最常使用的是二维数组,其次是三维数组。下面以三维数组为例对多维数组的创建及读取作简单介绍。

* 示例

多维数组的使用

示例将定义一个三维数组,并使用foreach语句将该数组输出。程序代码如下:

static void Main(string[] args)

{

//声明一个三维数组

int[, ,] arr3;

//初始化该三维数组

arr3 = new int[,,] { { { 1, 2, 3 } }, { { 4, 5, 6 } } };

//本教程来自网站源代码http://www.isstudy.com

//使用foreach语句遍历数组并输出

foreach (int i in arr3)

{

Console.WriteLine(i);

}

}

键运行程序,运行结果如图1所示。



图1 三维数组示例运行结果图

完整程序代码如下:

★★★★★主程序文件完整程序代码★★★★★

using System;

using System.Collections.Generic;

using System.Text;

namespace _3

{

class Program

{

static void Main(string[] args)

{

//声明一个三维数组

int[, ,] arr3;

//初始化该三维数组

arr3 = new int[,,] { { { 1, 2, 3 } }, { { 4, 5, 6 } } };

//使用foreach语句遍历数组并输出

//本教程来自网站源代码
http://www.isstudy.com

foreach (int i in arr3)

{

Console.WriteLine(i);

}

}

}

}




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.