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 |
run time erro?#include<iostream> using namespace std; int main() { int n,a[20],i; while(cin>>n) { if(n==0) break; int mn=1001,x=-1,sum=0,aver; for(i=0;i<n;i++) { cin>>a[i]; sum=sum+a[i]; if(a[i]<mn) mn=a[i]; if(a[i]>x) x=a[i]; } aver=(sum-x-mn)/(n-2); cout<<aver<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator