Created
October 2, 2018 06:39
-
-
Save ichiroku11/92bd4f6ab5623216b693efbf40bb5ca2 to your computer and use it in GitHub Desktop.
2次元配列
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApp { | |
class Program { | |
static void Main(string[] args) { | |
var matrix = new string[,] { | |
{ "1-1", "1-2", "1-3" }, | |
{ "2-1", "2-2", "2-3" } | |
}; | |
for (var x = 0; x < matrix.GetLength(0); x++) { | |
for (var y = 0; y < matrix.GetLength(1); y++) { | |
Console.WriteLine(matrix[x, y]); | |
} | |
} | |
/* | |
1-1 | |
1-2 | |
1-3 | |
2-1 | |
2-2 | |
2-3 | |
*/ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment