

帮忙看看有什么错误
输入M个班级(每个班级N个学生) 学生的计算机文化基础课程成锁,请你设计一个西数来编程找出这些学生中成锁最商的同学 (假定最商分只有一名同学),返回最高成绩、该同学是第几个班级的第几个学生(斑级和学生编号均从1开始)。


动态数组和指针:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x, y, highestScore, highestClass, highestStudent;
int i, j;
int** score = 0;
scanf("%d %d", &x, &y);
score = (int**)malloc(sizeof(int*) * x);
for (i = 0; i < x; i++) {
score[i] = (int*)malloc(sizeof(int) * y);
for (j = 0; j < y; j++) {
scanf("%d", &score[i][j]);
if (i == 0 && j == 0) {
highestScore = score[i][j];
highestClass = i + 1;
highestStudent = j + 1;
}
else
{
if (score[i][j] > highestScore)
{
highestScore = score[i][j];
highestClass = i + 1;
highestStudent = j + 1;
}
}
}
}
printf("%d ", highestScore);
printf("%d %d", highestClass, highestStudent);
//释放内层
for (i = 0; i < x; i++)
free(score[i]);
free(score);
return 0;
}