#include <stdio.h>
int main()
{
float sum=0;
float sizesum=0;
float danlie=0;
float average=0;
int renshu;
int subject;
int lieshu;
printf("请输入总人数和总科目\n");
scanf("%d %d",&renshu,&subject);
int arr[renshu][subject];
for(int i=0;i<renshu;i++){
sum=0;
printf("请输入第 %d 个人的 %d 们科目成绩:\n",i+1,subject);
for (int j=0; j<subject; j++) {
scanf("%d", &arr[i][j]);
sum = sum+arr[i][j];
}
average = sum/subject;
sizesum = sizesum + sum;
printf("成绩总和为:%.f\n成绩的平均数为:%.2f",sum,average);
printf("\n\n");
}
printf("请输入将要计算总和的列数:");
scanf("%d",&lieshu);
for (int x=0; x<renshu; x++) {
danlie = danlie + arr[x][lieshu-1];
}
printf("该科目的平均分数为:%.2f\n",danlie/renshu);
printf("该科目的成绩总和为:%.2f\n",danlie);
printf("所有成绩的总和为:%.2f\n",sizesum);
}