#include <stdio.h>
#include <stdlib.h>
int main()
{
//二维数组的理解1是由n个一维数组所组成的
int i, j;
double score[5][3] = {
{55, 32, 37},
{54, 35, 29},
{57, 39, 36},
{68, 46, 68},
{37, 89, 68},
};
//遍历第一行数据:score[0]
for (i = 0; i < 3; i++)
{
printf("%.2lf\t",score[0][i]);
}
printf("\n");
//遍历第二行数据:score[1]
for (i = 0; i < 3; i++)
{
printf("%.2lf\t",score[1][i]);
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
//二维数组的理解1是由n个一维数组所组成的
int i, j;
double score[5][3] = {
{55, 32, 37},
{54, 35, 29},
{57, 39, 36},
{68, 46, 68},
{37, 89, 68},
};
for(i = 0; i < 5; i++)
{
for (j = 0; j < 3; j++)
{
printf("%.2lf\t",score[i][j]);
}
printf("\n");
}
return 0;
}