#include
#include
int main(int argc,char * argv[])
{
int x,i,fail=0;
double cj[100],average,total=0,fail_cj[100],*p_fail_cj=fail_cj;
printf("输入学生的人数:\n");
scanf("%d",&x);
printf("输入每个人的成绩:\n");
for(i=0;i
scanf("%lf",&cj[i]);
if(cj[i]<0)
{
break;
}
total+=cj[i];
if(cj[i]<60)
{
fail++;
*p_fail_cj=cj[i];
p_fail_cj++;
}
}
average=total/x;
printf("平均成绩为:%lf\n",average);
printf("不及格人数为:%d\n",fail);
printf("不及格的成绩有:\n");
for(i=0;i
printf("%lf\n",fail_cj[i]);
}
system("pause");
return 0;
}