Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
直接偷懒,但是没有忘去掉最低最高分,也木有忘删去末尾的零,求大牛解释~~~#include<iostream> #include<algorithm> using namespace std; int main() { double a[6],ava; while(scanf("%lf%lf%lf%lf%lf%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5])!=EOF&&a[1]&&a[2]&&a[3]&&a[4]&&a[5]&&a[0]) { sort(a,a+6); ava=(a[1]+a[2]+a[3]+a[4])/4.0; printf("%g\n",ava); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator