You are given an NxN matrix consisting of zeros and ones. You need to count the number of units in it.

Program matrica;
Uses CRT;
Var a: array [1..100, 1..100] of integer;
Suma, i, j, n: integer;
Begin
CLRSCR;
Write (‘enter the dimension of the matrix n =’);
Readln (n);
For i: = 1 to n do
For j: = 1 to n do
Begin
Write (‘a [‘, i, ‘,’, j, ‘] =’);
Readln (a [i, j]);
End;
Suma: = 0;
For i: = 1 to n do
For j: = 1 to n do
Begin
If a [i, j] = 1 then suma: = suma + 1;
End;
Writeln (‘the number of ones in the matrix =’, suma);
Repeat until keypressed;
End.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.