001、 元素为数组的数组: 二维数据
#include <stdio.h> int main(void) { int i, j; int tensu1[4][3] = {{91, 63, 78}, {67, 72, 46}, {89, 34, 53}, {32, 54, 34}}; int tensu2[4][3] = {{97, 67, 82}, {73, 43, 46}, {97, 56, 21}, {85, 46, 35}}; int sum[4][3]; for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { sum[i][j] = tensu1[i][j] + tensu2[i][j]; } } puts("first exam:"); for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { printf("%5d", tensu1[i][j]); } putchar('\n'); } puts("second exam:"); for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { printf("%5d", tensu2[i][j]); } putchar('\n'); } puts("exam sum:"); for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { printf("%5d", sum[i][j]); } putchar('\n'); } return 0; }