提交时间:2019-11-25 18:43:17

运行 ID: 2431

#include<iostream> using namespace std; int main(){ int num; double n[100]={0}; double max=0,min=100,sum=0; cin>>num; for(int i=0;i<num;i++){ cin>>n[i]; sum+=n[i]; if(n[i]>max) max=n[i]; if(n[i]<min) min=n[i]; } printf("%.1lf",(sum-max-min)/(num-2)); return 0; }