# 3184. 二维数组排序

#define M 100
//********** Specification of SortLines**********
void SortLines(int (*p)[M], int n, int m);
/* PreCondition:
p points to a two-dimensional array with n lines and
m integers in each line
PostCondition:
array is sorted satisfying to the specification
*/

/***************************************************************/
/*                                                             */
/*  DON'T MODIFY main function ANYWAY!                         */
/*                                                             */
/***************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define M 100
#define N 100
//********** Specification of SortLines **********
void SortLines(int (*p)[M], int n, int m)
/* PreCondition:
p points to a two-dimensional array with n lines and
m integers in each line
PostCondition:
array is sorted satisfying to the specification
*/
}
/***************************************************************/
int main()
{
int a[N][M];
int n,m,i,j;
int t,cas;
scanf("%d",&cas);
for(t=0; t<cas; t++)
{
memset(a,0,sizeof(a));
scanf("%d%d",&n,&m);
for (i=0; i<n; i++)
for (j=0; j<m; j++)
scanf("%d",&a[i][j]);
/***** function SortLines is called here *****/
SortLines(a,n,m);
/****************************************/
printf("case #%d:\n",t);
for (i=0; i<n; i++)
for (j=0; j<m; j++)
printf("%d%c",a[i][j],j<m-1?' ':'\n');
}
return 0;
}


450 人解决，487 人已尝试。

655 份提交通过，共有 2067 份提交。

1.6 EMB 奖励。