救命,为什么#2#3WA

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

你可以看一下我的思路 ```c #include<bits/stdc++.h> using namespace std; int n,m; double t,ans,maxx,minn,maxxx; double pjz(int c[]){ maxx=-1,minn=205; ans=0; for(int i=1;i<=m;i++){ if(c[i]<minn){ minn=c[i]; } if(c[i]>maxx){ maxx=c[i]; } ans+=c[i]; } return (ans-maxx-minn)/(m-2); } int main(){ maxxx=0; cin>>n>>m; for(int i=1;i<=n;i++){ int b[m+1]={0}; for(int j=1;j<=m;j++){ cin>>b[j]; } t=pjz(b); if(t>maxxx){ maxxx=t; } } printf("%.2lf",maxxx); return 0; } ```
by xuruying @ 2024-10-06 20:24:40


|