#include #include int main(){ int m,n,i,j; int count; int **a; while(~scanf("%d%d",&m,&n)) { if(m<3||n<3||m>20||n>20) continue; count=0; a=(int **)malloc(m*sizeof(int *)); for(i=0;i a[i-1][j]&&a[i][j]>a[i+1][j]&&a[i][j]>a[i][j-1]&&a[i][j]>a[i][j+1]) { count++; printf("%d %d %d\n",a[i][j],i+1,j+1); } if(count==0) printf("None %d %d\n",m,n); for(i=0;i
#include #include int main(){ int m,n,i,j; int count; int **a; while(~scanf("%d%d",&m,&n)) { if(m<3||n<3||m>20||n>20) continue; count=0; a=(int **)malloc(m*sizeof(int *)); for(i=0;i a[i-1][j]&&a[i][j]>a[i+1][j]&&a[i][j]>a[i][j-1]&&a[i][j]>a[i][j+1]) { count++; printf("%d %d %d\n",a[i][j],i+1,j+1); } if(count==0) printf("None %d %d\n",m,n); //for(i=0;i
不知道为什么不释放二维数组内存就可以通过测试。释放二维数组的内存就会出现异常退出!!!求指导