int score[][4] = {{97,90,88,95}, {76,89,75,83}, {60,70,88,82},{83,89,92,85},{75,73,72,78}}; int sum; int main(void) { int i,j,sum = 0; i = 0, j = 0; printf(" 중간1 중간2 기말1 기말2 합계 평균\n");
for ( i = 0 ; i < 5 ; i++) {printf("김범용 "); for ( j = 0 ; j < 4 ; j++) { if ( i = 0 ) {sum += score[0][j]; printf("%d ", score[i][j]);} else if ( i = 1 ) {sum += score[1][j]; printf("%d ", score[i][j]);} else if ( i = 2 ) {sum += score[2][j]; printf("%d ", score[i][j]);} else if ( i = 3 ) {sum += score[3][j]; printf("%d ", score[i][j]);} }printf("%d ", sum); printf("%d ", (sum / 4)); printf("\n"); } return 0;