这个程序满足你条件了,我vc6通过调试运行了
#include
void main()
{
float score[200][50]={0};
void inputscore(float**,int,int);
void printscore(float**,int,int);
int m,n;
printf("please decide M=");
scanf("%d",&m);
printf("please decide N=");
scanf("%d",&n);
inputscore(score,m,n);
printscore(score,m,n);
}
void inputscore(float score[200][50],int m,int n)
{
int i,j;
for(i=1;i<=m;i++)
{
printf("input student no%d's score\n",i);
for(j=1;j<=n;j++)
{
scanf("%f",*(score+i)+j);
flushall();
score[0][j]+=*(*(score+i)+j);
score[i][0]+=*(*(score+i)+j);
}
score[i][0]/扰行=n;
}
for(j=1;j<=n;j++)
score[0][j]/=m;
}
void printscore(float score[200][50],int m,int n)
{
int i,j;
printf("the score chart is:\n");
printf("NO\t");
for(j=1;j<=n;j++)
printf("score%d\t",j);
printf("average\n"缓肢哗);
for(i=1;i<=m;i++)
{
printf("%d\t",i);
for(j=1;j<=n;j++)
printf("%g\t",*(*(score+i)+j));
printf("%g\n",*(*(score+i)));
}
printf("average\t");
for(j=1;j<=n;j++)
printf("%g\t",*(*(score)+j));
printf("\饥兄n");
}