题解 | #公务员面试#

公务员面试

https://www.nowcoder.com/practice/f3a134908d5b41869f14f58307008a97

#include <iostream>
#include<deque>
#include<algorithm>
using namespace std;


int main() {
    int a[7];
    while (cin >> a[0] >> a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]) { // 注意 while 处理多个 case     
        float sum =0;
        sort(a,a+7);
        for(int i=1;i<6;i++)
        {
            sum+=a[i];
        }
        printf("%.2lf\n",sum/5);
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

06-26 10:08
门头沟学院 C++
北京Golang实习,一个月4700,吃住都不报,公司位置在海淀。请问友友怎么看呢?如果要租房的话有什么建议吗
码农索隆:租房肯定是合租了,剩下的钱,差不多够正常吃饭了,看看能不能学到东西吧
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
06-27 20:55
点赞 评论 收藏
分享
06-11 17:39
门头沟学院 Java
小呆呆的大鼻涕:卧槽,用户彻底怒了
点赞 评论 收藏
分享
星辰再现:裁员给校招生腾地方
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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