#include <stdio.h>
int main(int argc, const char * argv[])
{
struct Student {
int num;
char * name;
char sex;
float score;
};
struct Student stu[5] = {
{ 101, "Li ping", 'F', 45 },
{ 102, "Zhang ping", 'M', 62.5 },
{ 103, "He ping", 'F', 92.5 },
{ 104, "Cheng ping", 'M', 87 },
{ 105, "Wang ping", 'M', 58 }
};
int count = 0;
float sumScore = 0;
int length = sizeof(stu) / sizeof(stu[0]);
printf("%d\n", length);
for (int i = 0; i < length; i++) {
if (stu[i].score < 60.0) {
count++;
}
sumScore += stu[i].score;
}
printf("不及格人数 = %d , 平均分数是 %.2f\n", count,sumScore/length);
return 0;
}