View Code of Problem 51

#include<stdio.h>
#include<string.h>
#include<math.h>
 
int main(){
	
	int a,b[10][10];
	scanf("%d",&a);
	for(int i=0;i<a;i++)
		for(int j=0;j<a;j++)
			scanf("%d",&b[i][j]);
	int sum=0;
	for(int m=0;m<a;m++)
		for(int n=0;n<=m;n++)sum+=b[n][m];

	printf("%d",sum);

}

Double click to view unformatted code.


Back to problem 51