輸出4×4數(shù)組的對(duì)角線之和 求二維數(shù)組對(duì)角線方向數(shù)組元素如何求和?
求二維數(shù)組對(duì)角線方向數(shù)組元素如何求和?#包括和限制。H>main(){int a[3][3],sum=0,I,J/*以3*3的數(shù)組為例。我們也可以是另一個(gè)printf(“please input
求二維數(shù)組對(duì)角線方向數(shù)組元素如何求和?
#包括和限制。H>
main()
{
int a[3][3],sum=0,I,J/*以3*3的數(shù)組為例。我們也可以是另一個(gè)printf(“please input number:number:the input number:the input number:the input number:the input number:the input number:the input number:the input number:the input number:the input number:the input number:the please input number:the number of[i=0I< 3I
{
]{
!]{[for(J=0j(J=0j<)]3j)
{
!{[對(duì)于(J=0j[J(J=0j(J=0j< 3j)J)
!]{
][printf([I[I][I][I]/*
![sum=sum=a[I[I[I][2-2-I][2-I]///*右上角到右下角到左下角到左下角到右下角的底部底部最后一個(gè)的底部[“sum”=%dn,sum)
}