实现矩阵两条对角线元素的和,求问题所在
#include<stdio.h>int main()
{
int m[5][5];
int sum1,sum2;
int i,j;
printf("please elements:\n");
for(i=0;i<5;i++)
scanf("%d%d%d%d%d",&i,&j,&sum1,&sum2,&m[i][j]);
printf("enter:\n");
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
printf("%d",m[i][j]);
printf("\n");
}
sum1=sum1+m[i][j];
sum2=sum2+m[i][j];
printf("the results:\n%d%d\n",sum1,sum2);
return 0;
}