题解 | #公务员面试#

公务员面试

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);
        }
    }
}

全部评论

相关推荐

09-10 15:05
已编辑
门头沟学院 游戏后端
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务