1、
#include <stdio.h> int main(void) { int i, j, a[6][2], b[2] = {0}, c[6] = {0}; puts("please input the elements of array a."); for(i = 0; i < 6; i++) { for(j = 0; j < 2; j++) { printf("a[%d][%d] = ", i, j); scanf("%d", &a[i][j]); } } puts("\nshow the matrix form of array a."); for(i = 0; i < 6; i++) { for(j = 0; j < 2; j++) { printf("%4d", a[i][j]); } putchar('\n'); } putchar('\n'); for(i = 0; i < 2; i++) { for(j = 0; j < 6; j++) { b[i] += a[j][i]; } printf("sum majorNO.%d: %d, mean: %.2f\n", i + 1, b[i], (double)b[i] / 6); } putchar('\n'); for(i = 0; i < 6; i++) { for(j = 0; j < 2; j++) { c[i] += a[i][j]; } printf("sum student.NO.%d: %d, mean: %.2f\n", i + 1, c[i], (double)c[i] / 2); } return 0; }