View Code of Problem 51

#include<stdio.h>
int main()
{
	int N;
	scanf("%d",&N);
	int str[N][N];
	int i,j;
	for(i=0;i<N;i++){
		for(j=0;j<N;j++){
		   scanf("%d",&str[i][j]);	
		}
	
	}
	int sum=0; 
	for(i=N-1;i>=0;i--){
		  for(j=0;j<=i;j++){
					sum+=str[i][j];
			}
	}
	printf("%d ",sum);
	return 0;
}

Double click to view unformatted code.


Back to problem 51