数组类型 多维参数
来源:互联网 发布:淘宝图片设计软件 编辑:程序博客网 时间:2024/06/01 09:49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 多维参数
{
class Program
{
static void PrintArray(int[,] arr)
{
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 2; j++)
{
System.Console.WriteLine("Element({0},{1}) = {2}", i, j, arr[i, j]);
//记住:第一个 i 对应{0},第二个 j 对应{1},第三个arr[i,j]对应{2},就是这样的语法格式。
}
}
}
static void Main()
{
PrintArray(new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } });
Console.ReadLine();
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 多维参数
{
class Program
{
static void PrintArray(int[,] arr)
{
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 2; j++)
{
System.Console.WriteLine("Element({0},{1}) = {2}", i, j, arr[i, j]);
//记住:第一个 i 对应{0},第二个 j 对应{1},第三个arr[i,j]对应{2},就是这样的语法格式。
}
}
}
static void Main()
{
PrintArray(new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } });
Console.ReadLine();
}
}
}
0 0
- 数组类型 多维参数
- 多维数组的指针类型转换和参数传递
- C++多维数组参数
- 多维数组 函数参数传递
- 数组类型和多维数组传参
- 数组类型和多维数组本质
- 多维数组——整数类型
- 多维动态数组作为函数传递参数
- 二维数组参数的传递,多维同理
- 多维数组的指针做函数参数
- 关于多维数组做参数 的问题
- C语言多维数组参数传递问题
- 作为函数参数的多维数组
- C++中多维数组做参数
- 作为函数参数的多维数组
- C++多维数组参数的new
- C++ 指针 多维数组传递参数
- 传递多维数组参数(C++)
- 解决MySQL不允许从远程访问的方法
- Android Fragment 详细翻译
- Android中RelativeLayout的属性详解
- 使用 GCD 自定义 UIImageView 增加异步下载图片的类别
- leetcode: (191) Number of 1 Bits
- 数组类型 多维参数
- hdu 1671
- Intent填坑
- A simple problem
- Android Studio调试功能使用总结【转】
- ListView的运行效率与点击事件
- java中日期工具类
- Visual C#2010学习笔记八之out和ref的使用
- HDU 2068 RPG的错排(错排+排列组合)