求大佬帮忙看看错误在哪呗!!!
by ysy2021 @ 2021-04-08 17:21:01
ememem 看错n,m了! 但是改了后,测试点3还是错的。
```c
# include <stdio.h>
int a[105];
int b[105];
int c[105];
int m, n, i, j, k, p;
void sort(int * pA, int len);
int main()
{
scanf("%d%d", &n, &m);
p = n;
while(p--)
{
for (i=0; i<m; ++i)
scanf("%d", &a[i]);
sort(a, m);
for (i=0; i<n-1; ++i)
{
b[0] = a[0];
b[i+1] = a[i+1]+b[i];
}
c[p-1] = b[m-2]-b[0];
}
sort(c, n);
printf("%.2lf", 1.0*c[0]/(m-2));
return 0;
}
void sort(int * pA, int len)
{
for (i=0; i<len-1; ++i)
{
for (j=0; j<len-i-1; ++j)
{
if (pA[j]<pA[j+1])
{
k = pA[j];
pA[j] = pA[j+1];
pA[j+1] = k;
k = 0;
}
}
}
}
```
by ysy2021 @ 2021-04-08 17:37:42
@[ysy2021](/user/496699)
数据帮你下下来了
in:
```
1 18
3 4 8 6 0 10 9 3 10 10 10 4 1 1 6 2 5 2
```
out:
```
5.25
by Textbook_blasphemy @ 2021-04-08 18:06:02
@[陶(戴)佳伟](/user/328443)
额,,能给我说一下这是什么意思吗??这个数据是我没有通过的数据吗?
by ysy2021 @ 2021-04-08 18:15:58
@[ysy2021](/user/496699) 嗯
by Textbook_blasphemy @ 2021-04-08 19:53:56