![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
C语言求解: 使用一个3行4列的二维数组,存储浮点数1至12,并分成3行输出,每行4列。
展开全部
#include<stdio.h>
void main(){
int i,j;
float a[3][4];
for(i=0; i<3; i++){
for(j=0;j<4;j++){
a[i][j]=i*4+j+1;
printf("%f ",a[i][j]);
}
printf("\n");
}
}
运行结果:
1.000000 2.000000 3.000000 4.000000
5.000000 6.000000 7.000000 8.000000
9.000000 10.000000 11.000000 12.000000
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询