私はこのコードの各行の前に「ゲーム」を表示しようとしていますが、最後に表示され続けますので、ループを修正する方法を考えることができません正しい時刻に新しい行が作成されます。あなたのコード順序付き配列の書式設定エラーを使用するループ
ここConsole.WriteLine("Game" + lottoN[x, y] + " ");
}else {
Console.Write($"{lottoN[x, y],2}" + " ");
で
static void Main() {
int[,] lottoNumbers ={
{ 4, 7, 19, 23, 28, 36},
{14, 18, 26, 34, 38, 45},
{ 8, 10,11, 19, 28, 30},
{15, 17, 19, 24, 43, 44},
{10, 27, 29, 30, 32, 41},
{ 9, 13, 26, 32, 37, 43},
{ 1, 3, 25, 27, 35, 41},
{ 7, 9, 17, 26, 28, 44},
{17, 18, 20, 28, 33, 38}
};
int[] drawNumbers = new int[] { 44, 9, 17, 43, 26, 7, 28, 19 };
PrintLottoNumbers(lottoNumbers);
ExitProgram();
}//end Main
static void PrintLottoNumbers(int[,] lottoN)
{
for (int x = 0; x < lottoN.GetLength(0); x++) {
for (int y = 0; y < lottoN.GetLength(1); y++) {
if(y < 1 && x > 0)
{
Console.WriteLine("Game" + lottoN[x, y] + " ");
}else {
Console.Write($"{lottoN[x, y],2}" + " ");
//Console.Write(lottoN[x, y] + " ");
}
}
}
}//Print Function For Lotto Numbers
パーフェクト!ありがとう、たくさんの人! – BobFisher3