それ自体は問題のない配列を表示しようとしています。If statement
ただし、表示されている配列の現在の反復がscore[]
300 に等しい場合、その後に aを追加するように、を追加したいと考えて*
います。何かのようなもの300*
また、配列は最高から最低まで表示する必要があります。これは、配列内にある瞬間に表示を最低から最高に反転することによって行っています。スワップを使用して順序を逆にすることを考えていましたが、必要がなければこの方法で解決したいと思います。
これまでのところ、私は得ています
400
332
300*
300
または私が試した別の方法で、私は得ました
0
0
300*
300
250
221
表示と出力に問題があります。
static void Output(int iteration, int[] score, string[] player, double average)
{ //opening output
Console.WriteLine("\n\t****** OUTPUT ******");
Console.WriteLine("\nScores for this game.\n");
if (score[iteration - 1] == 300)
{
Console.WriteLine("{0} score was {1}*", player[iteration - 1], score[iteration - 1]);
}
for (int i = iteration; i <= MAX_SIZE_ARRAY; i--)
{
//iterates through the loop to display all the players name then score
Console.WriteLine("{0} score was {1}", player[i], score[i]);
}
//displays high, low, and average score
Console.WriteLine("\nThe high score was {0} with {1} points", player[iteration - 1], score[iteration - 1]);
Console.WriteLine("The low score was {0} with {1} points", player[0], score[0]);
Console.WriteLine("The team average score was {0}", average);
}
}
}