程序定义了N×N的二维数组使数组左下半三角元素中的值加上n。如:若n...答:int main(){ int i,j,a[3][3] = {{2,5,4},{1,6,9},{5,3,7}}; for(i=0;i<=2;i++) { for(j=0;j<=2;j++) { if(i>=j) { a[i][j] = a[i][j] +3; } printf("%d ",a[i][j]); } printf("\n"); }} ...
下列程序定义了N×N的二维数组,并在主函数中赋值。请编写函数fun,fun函 ...答:fun(int a[N][N]) { int i,s=0; for ( i=0;i<N;i++ ) s+=a[i][i]; return s; } int main() {int a[N][N]={0,1,2,7,9,1,9,7,4,5,2,3,8,3,14,5,6,8,2,5,9,1,4,1}; int i,j,s;s=fun(a); printf("Thesumis:%d\n",s); return 0;} ...