#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;
}
