40分求助

P5738 【深基7.例4】歌唱比赛

```cpp #include<iostream> #include<iomanip> using namespace std; int main(){ double a,b,c,d,x,y,z=-1,o; cin>>a>>b; for(int e=1;e<=a;e++){ c=-1;d=9999999;x=0; for(int f=1;f<=b;f++){ cin>>y; if(y>c){ c=y; } if(y<d){ d=y; } x+=y; } x=(x-c-d)/(b-2); if(x>z){ z=x; } } cout<<fixed<<setprecision(2)<<z; } ``
by chenyixiang @ 2022-09-24 16:52:45


|