改为下面的程序,会得到你想要的结果
?#include<stdio.h>
int?main()
{?
int?a[5][5];?
int?getdata(int?b[5][5]);?
int?output(int?c[5][5]);?
getdata(a);?
output(a);?
return?0;
}
int?getdata(int?b[5][5])
{
?int?i,j,x=1;?
?for(i=0;i<=4;i++)?
for(j=0;j<=4;j++)
{ b[i][j]=x; ?
printf("%d\t",x);
if(x%5==0)printf("\n");
x++;?
}?
return?0;
}
int?output(int?c[5][5])
{ int?m,n;?
for(m=0;m<=4;m++)?
{? for(n=0;n<=4;n++)?
{
if(m<=n)
printf("%d\t",c[m][n]);?
?else
?printf("\t");?
?}?
?printf("\n");?
?}
?
?return?0;
?}