View Code of Problem 51

#include<bits/stdc++.h>
using namespace std;


int main()
{
	int n,sum=0,temp;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			scanf("%d",&temp);
			if(j<=i) sum+=temp;
		}
	}
	printf("%d",sum);
	
} 

Double click to view unformatted code.


Back to problem 51