View Code of Problem 51

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,sum=0;
	cin>>n;
	int a[n][n];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			cin>>a[i][j];
			if(i>=j)
			sum=sum+a[i][j];
		}
	}
	cout<<sum;
	return 0;
 } 
/*
Main.c:1:24: fatal error: bits/stdc++.h: No such file or directory
 #include<bits/stdc++.h>
                        ^
compilation terminated.
*/

Double click to view unformatted code.


Back to problem 51