老师给道题让运行结果,运行不了,高手来帮我分析下编码到底哪里错误了
#include<iostream.h>void main( )
{int a[3][3]={1,3,5,7,9,11,13,15,17}; int sum;
sum=func(a)'
cout<<" \nsum="<<sum<<"\n";
}
func(int a[ ][3])
{int i,j,sum=0;
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{a[[i][j]=i+j;
if(i= =j) sum=sum+a[i][j];
}
return(sum);
}