📄 program.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
namespace Example9_4 {
class Program {
static void Main(string[] args) {
int[][] myArray = new int[3][];
myArray[0] = new int[1] { 1 };
myArray[1] = new int[2] { 2, 3 };
myArray[2] = new int[3] { 4, 5, 6 };
//对交错数组myArray的外层数组进行遍历
foreach (int[] number in myArray) {
//对交错数组myArray的内层数组进行遍历
foreach (int i in number) {
Console.WriteLine("Element in array: {0}", i);
}
}
Console.ReadLine();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -