p5726
查看原帖
p5726
542430
13645254458q楼主2021/7/22 13:52
#include<bits/stdc++.h>
using namespace std;
int main()
{
	double n;
	cin>>n;
	double c=11;
	double e=0;
	double b;
	double d=0;
	if(n<=0)
	{
		cout<<fixed<<setprecision(2)<<n<<endl;
		return 0;
	}
	for(int a=1;a<=n;a++)
	{
		cin>>b;
		d=d+b;
		if(b<=c)
		{
			c=b;
		}
		else
		{
			c=c;
		}
	 	if(b>=e)
		{
			e=b;
		}
		else
		{
			e=e;
		}
	 } 
	 d=(d-e-c)/(n-2);
	 cout<<fixed<<setprecision(2)<<d<<endl;
	return 0;
 }
 //欢迎找错
2021/7/22 13:52
加载中...