I want the method to count all the maximum/minimum values in the 2D array poängInsamling. Each domare (=judge) gives a value to all deltagare (=members). I want to remove the maximum/minimum value of each deltagare. The code I have now only works if there are 2 or less members.
This is what I got:
for (int x = 0; x < deltagare; x++) {
for (int y = 0; y < domare; y++) {
if (poängInsamling[y][x] == -1) {
poängInsamling[y][x] = 0;
break;
}
}
}
return poängInsamling;
}
Thanks in advance, I've been trying to fix this for hours.
Edit: int[][]PoängInsamling = int[domare][deltagare];
If all deltagare has the same value, all their points end up 0.
poängInsamlinganddeltagare-- which points in the 2D array represent a singledeltagare?for (int i = 0; i < deltagare; i++) {;See this line? You should remove that semi-colon.