View Code of Problem 51

#include<stdio.h>
int main()
{
	int n,i,j;
	int a[20][20];
	int sum=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			scanf("%d",&a[i][j]) ;
			if(i<=j)
			sum+=a[i][j];
		}
	}
	printf("%d\n",sum);
	
 } 

Double click to view unformatted code.


Back to problem 51