2个回答
展开全部
这个可以用结构体实现:
typedef struct
{
float score1;
float score2;
float score3;
float score4;
}student;
int CheckScore(student *student)
{
if(student->score1<60||student->score2<60||student->score3<60||student->score4<60)
return 1;
else
return 0;
}
main()
{
student student[5];
int i;
for(i=0;i<5;i++)
if(CheckScore(&student[i]))
printf("%f,%f,%f,%f\n",student[i].score1,student[i].score2,student[i].score3,student[i].score4);
}
typedef struct
{
float score1;
float score2;
float score3;
float score4;
}student;
int CheckScore(student *student)
{
if(student->score1<60||student->score2<60||student->score3<60||student->score4<60)
return 1;
else
return 0;
}
main()
{
student student[5];
int i;
for(i=0;i<5;i++)
if(CheckScore(&student[i]))
printf("%f,%f,%f,%f\n",student[i].score1,student[i].score2,student[i].score3,student[i].score4);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询