填空题
下面程序是求出数组arr的两条对角线上的元素之和,请填空。
#include"stdio.h"
main()
{
int arr[3][3]={2,3,4,8,3,2,7,9,8),a=0,b=0,i,j;
for(i=0;i<3;i++)
for(j=0;<3;j++)
if(i=j)
a=a+arr[i][j];
flor(i=0;i<3;i++)
for(______;j>=0;j--)
if(______==2)
b=b+arr[i][j];
printf("%d,%d\n",a,b);
}
【参考答案】
j=2