#include
#include
int main()
{
int *p1, *p2, *p3;
int i, n;
char ch;
printf("qing shu ru jie shu:");
scanf("%d", &n);
p1 = (int*)malloc(n*n*sizeof(int));
p2 = (int*)malloc(n*n*sizeof(int));
p3 = (int*)malloc(n*n*sizeof(int));
printf("qing shu ru ju zhen:\n");
for (i = 0; i < n*n; i++)
scanf("%d", p1 + i);
for (i = 0; i < n*n; i++)
scanf("%d", p2 + i);
for (i = 0; i < n*n; i++)
*(p3 + i) = *(p1 + i) - *(p2 + i);
for (i = 0; i < n*n; i++)
{
printf("%5d", *(p3 + i));
if (i%n == n - 1)printf("\n");
}
free(p1);
free(p2);
free(p3);
getch();
}
不知道是不是这个意思