View Code of Problem 51

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,i,j;
   scanf("%d",&n);
   int a[n][n],res=0;
   for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
        scanf("%d",&a[i][j]);
        if(j>=i)res+=a[i][j];}
   }
   printf("%d",res);
    return 0 ;
}

Double click to view unformatted code.


Back to problem 51