===== PASCALABC.NET =====
begin
var n := ReadInteger('n =');
var a := MatrRandom(n, n, -99, 99);
a.Println;
var s := 0;
for var row := 0 to n - 2 do
for var col := row + 1 to n - 1 do
if a[row, col] mod 3 = 0 then
s += a[row, col];
Print(s)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
===== PASCALABC.NET =====
begin
var n := ReadInteger('n =');
var a := MatrRandom(n, n, -99, 99);
a.Println;
var s := 0;
for var row := 0 to n - 2 do
for var col := row + 1 to n - 1 do
if a[row, col] mod 3 = 0 then
s += a[row, col];
Print(s)
end.