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 |
60题水过纪念,不用再来写这里代码直接贴#include<iostream> #include<algorithm> using namespace std; int main() { int n,a[100],i,sum,t; while(cin>>n&&n) { sum=0; t=0; memset(a,0,sizeof(a)); for(i=0;i<n;i++) cin>>a[i]; sort(a,a+n); for(i=1;i<n-1;i++) sum=sum+a[i]; t=sum/(n-2); cout<<t<<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