以下是引用AnZai_Zero在2011-11-23 23:04:37的发言:
#include<stdio.h>
int main()
{
int nember1[2][3]={{1,2,3},{4,5,6}} ;
int nember2[2][3]={{1,2,3},{4,5,6}} ;
int sum[2][3];
int i,j;
for(i=0;i<=1;i++,printf("\n"))
{
for(j=0;j<=2;j++)
{
sum[j]=nember1[j] + nember2[j];
printf("%4d",sum[j]);
}
}
return 0;
}应该这样才算可以
这样可读性好一点吧
程序代码:
#include<stdio.h>
int main()
{
int nember1[2][3]={{1,2,3},{4,5,6}} ;
int nember2[2][3]={{1,2,3},{4,5,6}} ;
int sum[2][3];
int i,j;
for(i=0;i<=1;i++)
{
for(j=0;j<=2;j++)
{
sum[i][j]=nember1[i][j] + nember2[i][j];
printf("%4d",sum[i][j]);
}
printf("\n");
}
return 0;
}