c++求二位数组对角线元素之和

2024-12-01 09:42:41
推荐回答(1个)
回答1:

#include
void main()
{
int arr[100][100],n,m,i,j;
long sum=0;
scanf("%d%d"慧尺肢,&m,&n);
for(j=0;j for(i=0;i scanf("前世%d",&arr[j][i]);
for(i=0;i sum+=arr[i][i]+arr[i][n-i-1];
printf("%d\n"困配,sum);

}