View Code of Problem 51

#include<stdio.h>
#include<stdbool.h>
#include<math.h>
int main(){
int a;
scanf("%d",&a);
int r[10][10]={};
int b=a;
int sum=0;
int l;
for(int i=0;i<a;i++){
    for(int j=0;j<a;j++){
        scanf("%d",&r[i][j]);
        }
}

for(int v=0;v<a;v++){
    for(int g=0;g<=v;g++)
        sum=sum+r[v][g];
}
printf("%d\n",sum);


return 0;
}

Double click to view unformatted code.


Back to problem 51