#include <myhead.h>
struct stu
{
char name[30];
int age;
float score;
};
int main(int argc, const char *argv[])
{ int i,sum=0,x;
struct stu s[3] ={
{"张三",19,88.5},
{"李四",20,81},
{"王五",22,99}};
for(i=0;i<3;i++)
{
printf("姓名:%s,年龄:%d,分数%.2f\n",s[i].name,s[i].age,s[i].score);
}
int min=s[0].score;
for(i=0;i<3;i++)
{
sum=sum+s[i].score;
if(min>s[i].score)
{
min=s[i].score;
x=i;
}
}
printf("最低成绩的学生是%s,成绩为:%.2f",s[x].name,s[x].score);
return 0;
}