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 |
Re:水题,没人发贴 顶一下In Reply To:水题,没人发贴 顶一下 Posted by:liangyifeng_rjxy at 2007-09-14 16:36:12 > ..... #include<iostream> using namespace std; int main() { int n; while(scanf("%d",&n)&&n!=0){ int i,a[1000],sum=0,min=1000000,max=0; for(i=0;i<n;i++){ scanf("%d",&a[i]); sum+=a[i]; if(a[i]>max) max=a[i]; if(a[i]<min) min=a[i]; } sum=sum-max-min; sum/=(n-2); printf("%d\n",sum); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator