#include <stdio.h>
struct STUDENT
{
char name[20];
int ten1;
int ten2;
int ten3;
int tenf;
};
void tensyori(struct STUDENT *x);
int main(void)
{
struct STUDENT a = {"sanaka", 70, 65, 80, 0};
tensyori(&a);
printf("氏名=%s 得点=%d", a.
name, a.
tenf); }
void tensyori(struct STUDENT *x)
{
x->tenf = x->ten1;
if (x->ten2 > x->ten1)x->tenf = x->ten2;
if (x->ten3 > x->ten1)x->tenf = x->ten3;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnN0cnVjdCBTVFVERU5UCnsKICAgIGNoYXIgbmFtZVsyMF07CiAgICBpbnQgdGVuMTsKICAgIGludCB0ZW4yOwogICAgaW50IHRlbjM7CiAgICBpbnQgdGVuZjsKfTsKCnZvaWQgdGVuc3lvcmkoc3RydWN0IFNUVURFTlQgKngpOwppbnQgbWFpbih2b2lkKQp7CiAgICBzdHJ1Y3QgU1RVREVOVCBhID0geyJzYW5ha2EiLCA3MCwgNjUsIDgwLCAwfTsKICAgIHRlbnN5b3JpKCZhKTsKICAgIHByaW50Zigi5rCP5ZCNPSVzICDlvpfngrk9JWQiLCBhLm5hbWUsIGEudGVuZik7Cn0KCnZvaWQgdGVuc3lvcmkoc3RydWN0IFNUVURFTlQgKngpCnsKICAgIHgtPnRlbmYgPSB4LT50ZW4xOwogICAgaWYgKHgtPnRlbjIgPiB4LT50ZW4xKXgtPnRlbmYgPSB4LT50ZW4yOwogICAgaWYgKHgtPnRlbjMgPiB4LT50ZW4xKXgtPnRlbmYgPSB4LT50ZW4zOwp9Cg==