📄 c5-04.cs
字号:
//使用数组的示例
using System;
class DeclareArraysSample
{
public static void Main()
{
// 一维数组
int[] numbers = new int[5];
// 多维数组
string[,] names = new string[5,4];
// 交错数组
byte[][] scores = new byte[5][];
for (int i = 0; i < scores.Length; i++)
{
scores[i] = new byte[i+3];
}
// 打印每行长度
for (int i = 0; i < scores.Length; i++)
{
Console.WriteLine("第{0}行的长度为{1}!", i, scores[i].Length);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -