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 i; int max,min,a[6]; double s,r; while (1) { for (i = 0; i < 6; i++) cin >> a[i]; i = 0; while (i < 6 && a[i++] == 0); if (i == 6) break; s = a[0]; max = a[0]; min = a[0]; for (i = 1; i < 6; i++) { s += a[i]; if (a[i] > max) max = a[i]; else if (a[i] < min) min = a[i]; } s = s - max - min; r = s / 4.0; cout << r << endl; } return 1; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator