#include<stdio.h>
#include<string.h>
struct student{
char name[10];
int math;
int physics;
int english;
double ave;
};
struct student Average(struct student a){
a.ave = (double)(a.math+a.physics+a.english)/3;
return a;
}
int main(void){
struct student s1;
struct student a;
printf("Please input name: ");
scanf("%s",a.name);
printf("Please input math score: ");
scanf("%d",&a.math);
printf("Please input physics score: ");
scanf("%d",&a.physics);
printf("Please input english score: ");
scanf("%d",&a.english);
s1 = Average(s1);
printf("name: %s\n", a.name);
printf("math: %3d\n", a.math);
printf("physics: %3d\n", a.physics);
printf("english: %3d\n", a.english);
printf("ave: %1f\n", s1.ave);
return 0;
}