题解 | #公务员面试#
公务员面试
http://www.nowcoder.com/practice/f3a134908d5b41869f14f58307008a97
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] score=new int[7]; while(sc.hasNext()) { for(int i=0;i<7;i++) { score[i]=sc.nextInt(); } Arrays.sort(score); double average=(score[1]+score[2]+score[3]+score[4]+score[5])/5.0; System.out.printf("%.2f\n",average); } } }