#include<iostream.h>
#include <stdio.h>
main ()
{
int i,j,r,s,a[50][50],n;
cin>>n;
for (i=0; i<n; i++)
for (j=0; j<n; j++){cin>>a[i][j];}
printf("Engizilgen matrix:\n");
for (i=0; i<n; i++)
{for (j=0; j<n; j++)
printf(" %2i",a[i][j]);
printf("\n");
}
s=0;
cout<<"bas diagonaldagi men onin astindagi element summasi:";
for (i=0; i<n; i++)
for (j=0; j<n; j++)
if (j<=i) s+=a[i][j];
cout<<s;
return 0;
}