能帮忙看一下哪里出了问题吗?
#include<stdio.h>int name,subject;
float sum1[2]={0},sum2[5]={0},ave1[2],ave2[5],max=0,sum3=0,ave3;
float numbers(float a[][5])
{float o;
int i,j;
for(i=0;i<2;i++)
for(j=0;j<5;j++)
{sum1[i]=sum1[i]+a[i][j];
sum3=sum3+a[i][j];
if(max=max<a[i][j])
{max=a[i][j];
name=i+1;
subject=j+1;}}
for(i=0;i<5;i++)
for(j=0;j<2;j++)
sum2[i]=sum2[i]+a[j][i];
for(i=0;i<2;i++)
ave1[i]=sum1[i]/5;
for(j=0;j<5;j++)
ave2[j]=sum2[j]/2;
ave3=sum3/5;
o=ave3*ave3/2-(ave3*ave3)/(2*2);
return o;}
int main()
{float a[2][5]={{1,2,3,4,5},{2,3,4,5,6}};
float o;
o=numbers(a[2][5]);
printf("max=%f,sum3=%f,o=%f,name=%d,subject=%d\n",max,sum3,o,name,subject);
return 0;}
H:\7.c(11) : warning C4244: '=' : conversion from 'int ' to 'float ', possible loss of data
H:\7.c(28) : error C2115: 'function' : incompatible types
H:\7.c(28) : warning C4024: 'numbers' : different types for formal and actual parameter 1
谢谢了