所以我有一些在数组中输出重复值的工作代码,但是在屏幕上输出重复值总是很短,我知道这与下面的代码有关,但是我无法将它放在上面。请注意,我不能使用任何System.Array
。
for (column = 0; column < WinningScores.Length -1 ; column++)
{
if (WinningScores[column] == WinningScores[column + 1])
{
duplicateScore = WinningScores[column];
duplicateIndex = column;
Console.Write("\n Competitor {0} is the Winner with a total of: {1}",
duplicateIndex + 1,
duplicateScore - totalSum);
}
}
//Starts loop through first element
for(int i = 0; i < arr.length, i++)
//starts at second element in array
for(int j = i + 1; k < arr.length, j++)
//double check my logic though, in a hurry at work so had to post this in a rush.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句