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 |
WA 请教#include <iostream> using namespace std; int main () { int num[6]; for (int j=0;j<6;j++) cin>>num[j]; while (num[0]!=0&&num[1]!=0&&num[2]!=0&&num[3]!=0&&num[4]!=0&&num[5]!=0) { int max,min; float avg=0; max=num[0]; min=num[0]; for (int i=1;i<6;i++) { if (num[i]>max) max=num[i]; if (num[i]<min) min=num[i]; } avg=(num[0]+num[1]+num[2]+num[3]+num[4]+num[5]-max-min)/4.0; cout<<avg<<endl; for (int j=0;j<6;j++) cin>>num[j]; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator