#include <stdio.h>
struct team{
char name[32];// 姓名
long tel;// 电话
char sex;// 性别
float score;// 成绩
};
struct team n1={"wang",123456,'m',13.2};
struct team n2={"li",23456,'w',70.8};
struct team n3={"qian",367,'m',90.4};
void main() {
float avg;
avg=(n1.score+n2.score+n3.score)/3.0;
printf("%f",avg); //58.133335
}
C语言 计算平均分
于 2021-03-28 01:57:43 首次发布