所以这就是我到目前为止所拥有的,我不知道为什么程序没有按照我想要的方式响应。不断显示“avg2 可能尚未初始化”。有任何想法吗??
if (a < b && a < c) {
System.out.println("The lowest score was: " + a);
System.out.println("The average without the lowest score is: " + ((b + c) / 2));
avg2 = ((b + c) / 2);
}
if (b < a && b < c) {
System.out.println("The lowest score was: " + b);
System.out.println("The average without the lowest score is: " + ((a + c) / 2));
avg2 = ((a + c) / 2);
}
if (c < a && c < b) {
System.out.println("The lowest score was: " + c);
System.out.println("The average without the lowest score is: " + ((a + b) / 2));
avg2 = ((a + b) / 2);
}