OJ-Problems-Source/POJ/3507.cpp

25 lines
465 B
C++
Raw Normal View History

2016-09-13 16:07:03 +08:00
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
int bus[6];
int main()
{
while(1)
{
for(int i=0;i<6;i++)
{
scanf("%d",&bus[i]);
}
if(!(bus[0]|bus[1]|bus[2]|bus[3]|bus[4]|bus[5])) /// Good way
return 0;
sort(bus,bus+6);
int sum=bus[1]+bus[2]+bus[3]+bus[4];
double ans=sum/4.0;
printf("%g\n",ans);
}
return 0;
}