用一维数组写的,写麻烦了呢,哈哈
#include<stdio.h>
#include<math.h>
int main()
{
int n = 1, m = 1, high = 0;
float locat = 0;
int arr[100] = { 0 };
scanf("%d %d", &n, &m);
for (int i = 0; i < m * n; i++)
{
scanf("%d", &arr[i]);
if (i == 0)
{
locat = 1.0;
high = arr[0];
}
else
{
if (arr[i] > high)
{
locat = i + 1.0;
high = arr[i];
}
}
}
int a = (int)ceil(locat / m);
int b = (int)(locat - (ceil(locat / m)-1) * m);
printf("%d %d",a,b);
return 0;
}