| ||||||||||
| 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>
using namespace std;
int main()
{
int max,min;
int count=0;
int a[6];
while(1)
{
count=0;
for(int j=0;j<6;j++)
{
scanf("%d",&a[j]);
}
for(int i=0;i<6;i++)
{
if(a[i]==0)
count++;
}
if(count==6)
break;
max=a[0];
min=a[0];int s=0;
for(int t=0;t<6;t++)
{
if(a[t]<min)
min=a[t];
if(a[t]>max)
max=a[t];
s+=a[t];
}
s-=max+min;
if(s%4==0)
{
printf("%d\n",s/4);
}
else
{
double u;
u=(double)s;
printf("%.1lf\n",u/4);
}
}
system("pause");
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator