一起答
主观

求主次对角线之和。

main

{static int a[ ][3]={9,7,5,1,2,4,6,8};

int I,j,s1=0,s2=0;

for(I=0;I<3;I++)

for(j=0;j<3;j++)

{if(__________)

s1=s1+a[I][j];

if( __________ )

s2=s2+a[I][j];

}

printf(“%d\n%d\n”,s1,s2);

}

试题出自试卷《2014年全国计算机等级《二级C语言程序设计》考点习题测试(1)》
参考答案
查看试卷详情