``
int a[10000][10000];
``
开不下。
by gybtx @ 2022-11-22 16:15:23
@[lijiatu123](/user/811425) t=0
by 许多 @ 2022-11-22 16:16:26
没初始化,但还是WA了
by 许多 @ 2022-11-22 16:16:48
``t``有声明无定义,UB
by gybtx @ 2022-11-22 16:17:56
还有好多,你p,b数组都是int。应该是double
by 许多 @ 2022-11-22 16:18:58
等下,我再找找
by 许多 @ 2022-11-22 16:24:31
好了,帮你A了
你的代码好多不必要的,我也帮你删了
```cpp
#include<stdio.h>
int main() {
double maxx=0,b[10000];
int n,m,min,max,sum,i,j,a[10000][10000];
scanf("%d%d",&n,&m);
for(i=1; i<=n; i++) {
min=10,max=0;sum=0;
for(j=1; j<=m; j++) {
scanf("%d",&a[i][j]);
if(min>a[i][j])
min=a[i][j];
if(max<a[i][j])
max=a[i][j];
sum+=a[i][j];
}
b[i]=(double)(sum-min-max)/(double)(m-2);
}
for(i=1; i<=n; i++)
if(maxx<b[i])
maxx=b[i];
printf("%.2lf",maxx);
return 0;
}
```
by 许多 @ 2022-11-22 16:31:31
@[lijiatu123](/user/811425) ~~求关注~~
by 许多 @ 2022-11-22 16:31:59
@[许多](/user/230825) ```
必须的哥
by lijiatu123 @ 2022-11-22 18:19:25