数组初始化...
哪位ggjj帮着看看,矩阵怎么赋值?a=sin(0.2i+0.5j)(i=j)否则a=cos(0.3i+0.4j)
#include "math.h" #include "stdio.h" void main() {int i,j; float a[10][10]; for(i=0;i<=9;i++) {for(j=0;j<=9;j++) {if(i!=j) a[i][j]=cos(0.3*i+0.4*j); else a[i][j]=sin(0.2*i+0.5*j); } } for(i=0;i<=9;i++) {for(j=0;j<=9;j++) {printf("a=%13.7f\n",a[i][j]); printf("\n");} } }