Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

大牛帮我看一下我哪里错了??

Posted by QueenyLv at 2010-07-17 14:01:47 on Problem 3507
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator