System Error
ValueError("invalid literal for int() with base 10: ''",)
代码
#include <stdio.h>
#include <stdlib.h>
void score_average(int M, int N, float (*score)[N])
{
int i, j;
float sum = 0.0, ave;
for(i = 0; i < M; i++)
{
for(j = 0; j < N; j++)
{
sum = sum + score[i][j];
}
}
ave = sum / (M * N);
printf("%.1f\n", ave);
}
int main()
{
int M, N;
scanf("%d", &M);
scanf("%d", &N);
float score[M][N];
int i, j;
for(i = 0; i < M; i++)
{
for(j = 0; j < N; j++)
{
scanf("%f", &score[i][j]);
}
}
score_average(M, N, score);
return 0;
}