#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
struct student {
char name[ 20 ] ;
int kor;
int eng;
int mat;
int tot;
float avg;
} ;
int main( ) {
struct student s[ 5 ] ;
char name[ 20 ] ;
for ( int i = 0 ; i < 5 ; i++ ) {
scanf ( "%s %d %d %d" , s
[ i
] .
name , & s
[ i
] .
kor , & s
[ i
] .
eng , & s
[ i
] .
mat ) ; s[ i] .tot = s[ i] .kor + s[ i] .eng + s[ i] .mat ;
s[ i] .avg = s[ i] .tot / 3.0 ;
}
printf ( "이름\t 국어\t 영어\t 수학\t 합계\t 평균\n " ) ; printf ( "============================================\n " ) ; for ( int i = 0 ; i < 5 ; i++ ) {
printf ( "%s\t %d\t %d\t %d\t %d\t %f\n " , s
[ i
] .
name , s
[ i
] .
kor , s
[ i
] .
eng , s
[ i
] .
mat , s
[ i
] .
tot , s
[ i
] .
avg ) ; }
}
I2RlZmluZSBfQ1JUX1NFQ1VSRV9OT19XQVJOSU5HUwoKI2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3Qgc3R1ZGVudCB7CgljaGFyIG5hbWVbMjBdOwoJaW50IGtvcjsKCWludCBlbmc7CglpbnQgbWF0OwoJaW50IHRvdDsKCWZsb2F0IGF2ZzsKfTsKCmludCBtYWluKCkgewoJc3RydWN0IHN0dWRlbnQgc1s1XTsKCWNoYXIgbmFtZVsyMF07CgoJZm9yIChpbnQgaSA9IDA7IGkgPCA1OyBpKyspIHsKCQlwcmludGYoIuydtOumhCDqta0g7JiBIOyImOulvCDsnoXroKXtlZjshLjsmpQ6ICIpOwoJCXNjYW5mKCIlcyAlZCAlZCAlZCIsIHNbaV0ubmFtZSwgJnNbaV0ua29yLCAmc1tpXS5lbmcsICZzW2ldLm1hdCk7CgkJc1tpXS50b3QgPSBzW2ldLmtvciArIHNbaV0uZW5nICsgc1tpXS5tYXQ7CgkJc1tpXS5hdmcgPSBzW2ldLnRvdCAvIDMuMDsKCX0KCXByaW50Zigi7J2066aEXHTqta3slrRcdOyYgeyWtFx07IiY7ZWZXHTtlanqs4RcdO2Pieq3oFxuIik7CglwcmludGYoIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKCWZvciAoaW50IGkgPSAwOyBpIDwgNTsgaSsrKSB7CgkJcHJpbnRmKCIlc1x0JWRcdCVkXHQlZFx0JWRcdCVmXG4iLCBzW2ldLm5hbWUsIHNbaV0ua29yLCBzW2ldLmVuZywgc1tpXS5tYXQsIHNbaV0udG90LCBzW2ldLmF2Zyk7Cgl9Cn0=