help me!!!
查看原帖
help me!!!
1390387
vector_STL_楼主2024/8/28 16:54
#include<bits/stdc++.h>
using namespace std;

int main() {
    int n,h,maxn=0;
    cin>>n;
    vector<double>s(n);
    for(int i=1;i<=n;i++){
		double a;
		cin>>a;
		s.push_back(a);
		h=0;
		h=h+a;
	}
	
	h=h-*s.begin()-*s.end();
	*s.begin()=0;
	*s.end()=0;
	printf("%.2lf\40 ",h*1.0/s.size()-2);
	for(auto c:s){
		if(c>maxn){
			maxn=c;
		}
	}
	printf("%.2lf",maxn-h/s.size()*1.0);
	
    return 0;
}
2024/8/28 16:54
加载中...