Fork me on GitHub

NYOJ题目809摸底

-------------------------------

AC代码:

 1 import java.util.Arrays;
 2 import java.util.Scanner;
 3 
 4 public class Main {
 5 
 6     public static void main(String[] args) {
 7         
 8         Scanner sc=new Scanner(System.in);
 9         
10         int times=sc.nextInt();
11         while(times-->0){
12             
13             int a[]=new int[7];
14             for(int i=0;i<a.length;i++){
15                 a[i]=sc.nextInt();
16             }
17             
18             Arrays.sort(a);
19             
20             double ans=(a[0]+a[3]+a[6])/3.0;
21             System.out.printf("%.2f\n",ans);
22         }
23         
24     }
25     
26 }

 

题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=809

posted @ 2016-08-31 08:28  CC11001100  阅读(186)  评论(0编辑  收藏  举报