解题思路:
注意事项:导包
import java.util.Arrays;
参考代码:
public class 演讲大赛评分 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); while (in.hasNext()) { double[] scores = new double[7]; double sum = 0; for (int i = 0; i < scores.length; i++) { scores[i] = in.nextDouble(); } String name = in.next(); Arrays.sort(scores); for (int i = 1; i < scores.length - 1; i++) { sum += scores[i]; } System.out.printf("%s %.2f\n", name, sum / 5); } } }
0.0分
0 人评分