Sum Of all sub-matrix of a matrix

Sir, I am not gating correct output of my code.
#include

#include

using namespace std;

void sum_of_All_Submatrix(int a[100][100],int n)

{

int sum=0;

// For TopLeft..............

for(int li=0;li<n;li++)

{

    for(int lj=0;lj<n;lj++)

    {

        // For BottomRight.................

        for(int bi=li+1;bi<n;bi++) 

        {

            for(int bj=li+1;bj<n;bj++)

            {

                // For SUM...................

                for(int i=li;i<bi;i++)

                {

                    for(int j=lj;j<bj;j++)

                    {

                        sum=sum+a[i][j];

                    }

                }

            }

        }

    }

}

cout<<sum<<endl;

}

int main()

{

int n;

cin>>n;

int a[100][100]={0};

for(int i=0;i<n;i++){

   for(int j=0;j<n;j++)

   {

       cin>>a[i][j];

   }

}

sum_of_All_Submatrix(a,n);

return 0;

}

Sir, I did not get any reply regarding this problem, why?