#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;
}
#include
int main(){
double x;
double a[100];
double sum=0;
int i,tot=0,count=0;
scanf("%lf",&x);
while(x>=0){
sum+=x;
tot++;
if(x<60) a[count++]=x;
scanf("%lf",&x);
}
printf("%lf\n",sum/(double)tot);
printf("Fail: %d\n",count);
for(i=0;iprintf("%lf\n",a[i]);
return 0;
}