Create 3507.cpp

This commit is contained in:
Kirigaya Kazuto 2016-09-13 16:07:03 +08:00 committed by GitHub
parent 9b0039eab9
commit 42a2894cc4

24
POJ/3507.cpp Normal file
View File

@ -0,0 +1,24 @@
#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;
}