#include<stdio.h>
#include<string.h>
#include<math.h>
int x,y,temp,a[n][n];
int n;
int main()
{
int transpose(int a[][]);
printf("input:\n");
scanf("%d",&n);
for(x=0;x<n;x++)
{
for(y=0;y<n;y++)
{
scanf("%d",&a[x][y]);
}
}
transpose(a);
for(x=0;x<n;x++)
{
for(y=0;y<n;y++)
printf("%d ",a[x][y]);
printf("\n");
}
}
int transpose(int a[][])
{
for(x=0;x<n;x++)
for(y=x;y<n;y++)
{
temp=a[y][x];
a[y][x]=a[x][y];
a[x][y]=temp;
}
}
出现了狠多错误 但是我不知道该怎么修改 是二维数组定义出错吗