定义一个二维数组,存放10个学生的学号,三门课的成绩

急!

#include"stdio.h"
#define P 10void inputmessage(int student[][4])
{int i;<br> for(i=0;i<P;i++)<br> scanf("%d,%d,%d,%d",&student[i][0],&student[i][1],&student[i][2],&student[i][3]);</p><p>}void outputhighscore(int student[][4])
{
int i,j,max,sno;
for(j=1;j<4;j++)
{max=student[0][j];<br> sno=student[0][1];<br> for(i=0;i<P;i++)<br> {<br> if(student[i][j]>max)<br> {max=student[i][j];<br> sno=student[i][0];<br> } }
printf("\n第%d门课程最高的学生学号为:%d,成绩为:%d\n",j,sno,max);
} }void outputhighavg(int student[][4])
{int i,j,p;<br>float max;<br>float avg[P]={0};
for(i=0;i<P;i++)
{ for(j=1;j<4;j++)
{
avg[i]+=student[i][j];
}
avg[i]=avg[i]/3;
}
max=avg[0];p=0;
for(i=0;i<p;i++)
if(avg[i]>max){max=avg[i];p=i;}
printf("最高平均分为:%d %f",student[p][0],max);
}void main()
{
int student[P][4];
printf("输入学号,成绩1,成绩2,成绩3:\n");
inputmessage(student);
outputhighscore(student);
outputhighavg(student);}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-10-26
用VB程序写可以么
第2个回答  2013-10-26
你需要用哪个语言写这个功能;java,JavaScript,ActionScript,php,asp,C#,c++ ,ruby???

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网