#include <stdio.h>
#include <stdlib.h>
int arr[5][5];
void arrarr(char *namestr[],char *subject[])
{
int sum;
int i,j;
for(i=0;i<4;i++)
{
sum=0;
printf("%s의 성적 입력 \n",namestr[i]);
for(j=0;j<4;j++)
{
printf("%s 점수 : ",subject[j]);
scanf("%d", &arr[i][j]);
sum += arr[i][j];
}
arr[i][4]=sum;
}
}
void allarr(void)
{
int i,j;
for(i=0;i<5;i++)
{
for(j=0;j<5;j++) printf("%3d",arr[i][j]);
printf("\n");
}
}
void sumsum(void)
{
int sum=0;
int i,j;
for(i=0;i<4;i++)
{
sum=0;
for(j=0;j<4;j++)
sum+=arr[j][i];
arr[4][i]=sum;
arr[4][4]+=sum;
}
}
int main(void)
{
int i,j;
int sum=0;
char *namestr[4];
namestr[0]="철희";
namestr[1]="철수";
namestr[2]="영희";
namestr[3]="영수";
char *subject[4];
subject[0]="국어";
subject[1]="영어";
subject[2]="수학";
subject[3]="국사";
arrarr(namestr,subject);
sumsum();
allarr();
system("pause");
return 0;
}