include stdio include stdlib define define PN printf int main void int

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <stdlib.h>
#define N 4
#define PN printf("\n")
int main(void)
{ int mass[N][N],i,j,summ=0;
printf("INPUT MATRIX:\n");
//input matrix
for(i=0;i<N;i++)
for(j=0;j<N;j++)
scanf("%d", &mass[i][j]);
PN;
//job
for(i=0;i<N;i++)
for(j=0;j<N;j++)
if(j>N-i-1) summ+=mass[i][j];
//test
for(i=0;i<N;i++)
{for(j=0;j<N;j++)
printf("%d ", mass[i][j]);
PN;
}
PN;
//out
printf("%d\n",summ);
system("PAUSE");
return 0;
}