标签:
链接http://acm.swust.edu.cn/problem/278/
#include <stdio.h> int main() { int i,n; scanf("%d",&n); int a[105]; for(i=0;i<n;i++) { scanf("%d",&a[i]); } int sum=0,min=a[0],max=a[0]; for(i=0;i<n;i++) { sum=sum+a[i]; if(a[i]<min) min=a[i]; if(a[i]>max) max=a[i]; } sum=sum-min-max; double ans=sum*1.0/(n-2); printf("%.2lf\n",ans); return 0; }
标签:
原文地址:http://www.cnblogs.com/niconiconi/p/5721608.html