import java.util.Scanner;
public class Winners {
public static void main(String[] args) {
int numberOfLanes = 10;
int numberOfWinners = 5;
double[] finalTimes = new double[numberOfLanes];
int[] winners = new int[numberOfWinners];
Scanner keyboard = new Scanner(System.in);
String[] places = {"First", "Second", "Third", "Fourth", "Fifth"};
for (int i = 0; i < finalTimes.length; i++) {
System.out.print("Enter time for lane " + (i + 1) + ";");
finalTimes[i] = keyboard.nextDouble();
System.out.println(finalTimes[i]);
}
winners = determineWinners(finalTimes, numberOfWinners);
for (int i = 0; i < winners.length; i++) {
System.out.println(places + " place = Lane " +
winners[i + 1] + ". Time = " + "[winners[i]]" + " seconds.");}
}
public static int[] determineWinners(double[] copyTimes, int numberOfWinners) {
int winners = numberOfWinners;
double fastest;
int fastestLane = -1;
double[] times = new double[copyTimes.length];
for (int i = 0; i < copyTimes.length; i++){
copyTimes[i] = copyTimes[i];
}
for (int i = 0; i < numberOfWinners; i++) {
fastest = copyTimes[0];
fastestLane = 0;
for (int j = 1; j < copyTimes.length; j++) {
if (copyTimes[j] < fastest){
fastest = copyTimes[j];
fastestLane = j;
}
}
}
winners[i]= fastestLane; // ERROR! Multiple Markers at this line
copyTimes[fastestLane] = Double.MAX_VALUE;
}
}