일부 배열을 정렬 할 때 컴파일러에서 오류가 발생하는 데 문제가 있습니다. 나는 Arrays.sort로 그것을 또한 시도했다. 그러나, 행운이 없다.Java에서 정렬 문제
import java.util.Scanner;
public class CH6PA
{
private static double difficulty;
private static int score;
private double[] average = new double[7];
public static void main(String[]args)
{
Scanner keyboard = new Scanner (System.in);
do
{
System.out.println("Enter the level of difficulty (1.2-3.8)");
difficulty = keyboard.nextDouble();
}
while (difficulty<1.2 || difficulty>3.8);
int[] judge = new int[7];
for(int i = 0; i<judge.length; i++)
{
System.out.println("Enter the difficulty score for each judge (0-10)");
System.out.println("Enter the score for judge" + (i+1));
judge[i]=keyboard.nextInt();
while(score > 0 && score <=10);
}
sort(judge, judge.length);
System.out.println("Average = " + (judge[3] + judge[4] + judge[5]));
}
}
컴파일 오류가 발생했다는 것을 알려주지 않고 컴파일 오류 메시지의 내용과 오류가있는 행 *을 알려주십시오. –
이것은 숙제 문제처럼 보입니다. ** 힌트 **가 완전한 답보다 더 적합하다고 가정합니다. –