#include <stdio.h>
#define DATANUM 5
int main(){
typedef struct Seiseki{
int eigo;
int kokugo;
int sugaku;
float average;
} SEISEKI;
SEISEKI score[DATANUM];
int i;
/* 英語と国語と数学の点数を DATANUM 個読み込み、3科目の平均値を計算する */
for (i=0;i<DATANUM;i++){
scanf("%d",&(score
[i
].
eigo)); scanf("%d",&(score
[i
].
kokugo)); scanf("%d",&(score
[i
].
sugaku)); score[i].average = ((score[i].eigo) + (score[i].kokugo) + (score[i].sugaku))/5;
score[i].eigo = (score[i].eigo)/5;
score[i].kokugo = (score[i].kokugo)/5;
score[i].sugaku = (score[i].sugaku)/5;
}
/* 3科目の平均値を表示する */
for (i=0;i<DATANUM;i++){
printf("%d 人目の人の3 科目平均は%3.1f です。\n",i
+1, score
[i
].
average); printf("英語の平均点は %3.1f 点です。\n"); printf("国語の平均点は %3.1f 点です。\n"); printf("数学の平均点は %3.1f 点です。\n"); }
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNkZWZpbmUgREFUQU5VTSA1CgppbnQgbWFpbigpewoJCgl0eXBlZGVmIHN0cnVjdCBTZWlzZWtpewoJCWludCBlaWdvOwoJCWludCBrb2t1Z287CgkJaW50IHN1Z2FrdTsKCQlmbG9hdCBhdmVyYWdlOwoJfSBTRUlTRUtJOwoJU0VJU0VLSSBzY29yZVtEQVRBTlVNXTsKCWludCBpOwoJCgkvKiDoi7Hoqp7jgajlm73oqp7jgajmlbDlrabjga7ngrnmlbDjgpIgREFUQU5VTSDlgIvoqq3jgb/ovrzjgb/jgIEz56eR55uu44Gu5bmz5Z2H5YCk44KS6KiI566X44GZ44KLICovCglmb3IgKGk9MDtpPERBVEFOVU07aSsrKXsKCQlzY2FuZigiJWQiLCYoc2NvcmVbaV0uZWlnbykpOwoJCXNjYW5mKCIlZCIsJihzY29yZVtpXS5rb2t1Z28pKTsKCQlzY2FuZigiJWQiLCYoc2NvcmVbaV0uc3VnYWt1KSk7CgkJc2NvcmVbaV0uYXZlcmFnZSA9ICgoc2Nv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