admin 管理员组

文章数量: 1087709

统计高于平均分的人数python

满意答案

yin_yi_jun

2013.09.11

采纳率:47%    等级:12

已帮助:5208人

# include

# include

# include

int fun(int point[],int n,int high[])

{

float ave=0;

int i,k=0; //初始化k=0即可

for (i=0;i<9;i++) ave+=point[i]/9;

for (n=0,i=0;i<9;i++)

if (point[i]>ave)

{

n++;

high[k++]=point[i];

}

return n;

}

main()

{

int j,m,high[9];

int point[9]={50,60,65,70,75,80,88,90,95};

FILE *out;

m=fun(point,9,high);

printf("\nHigh the average point are :");

out=fopen("outfile.dat","w");

for (j=0;j

{

printf("%d ",high[j]);

fprintf(out,"%d\n0",high[j]);

}

fclose(out);

}

00分享举报

本文标签: 统计高于平均分的人数python