#include#includedoublescore[10][5];doubleaverStudent[10];doubleaverClass[5];voidAverStudent(){inti,j;doublesum;for(i=0;i<10;i++){sum=0;for(j=0;j<5;j++)sum+=score[i][j];averStudent[i]=sum/5;}}voidAverClass(){inti,j;doublesum;for(j=0;j<5;j++){sum=0;for(i=0;i<10;i++)sum+=score[i][j];averClass[j]=sum/10;}}intmain(){inti,j;for(i=0;i<10;i++)for(j=0;j<5;j++){scanf("%lf",&score[i][j]);}AverStudent();AverClass();for(i=0;i<10;i++)printf("Student[%2d]=%g\n",i+1,averStudent[i]);printf("-------------------------------------------------\n");for(i=0;i<5;i++)printf("Class[%2d]=%g\n",i+1,averClass[i]);system("pause");}//自定义函数
温馨提示:答案为网友推荐,仅供参考