标签:style blog io os ar for sp 2014 on
【题意简述】:去掉一个最高分,去掉一个最低分,求平均分。
【分析】:此题和POJ3507其实质是一样的。
//732K 32Ms #include<iostream> #include<cmath> #include<algorithm> using namespace std; int score[101];//成绩 int main() { int t; int sum; while(1) { sum = 0; cin>>t; if(t == 0) break; for(int i = 0;i<t;i++) cin>>score[i]; sort(score,score+t); for(int i = 1;i<t-1;i++) { sum += score[i]; } cout<<sum/(t-2)<<endl; } return 0; }
POJ 3325 ICPC Score Totalizer Software(水题)
标签:style blog io os ar for sp 2014 on
原文地址:http://blog.csdn.net/u013749862/article/details/39585301