var a:array [1..22] of integer;
i,s:integer;
begin
write('Массив: ');
for i:=1 to 22 do
a[i]:=random(13);
if i=22 then a[i]:=11;
write(a[i],' ');
if a[i] mod 4 = 0 then s:=s+a[i]
end;
writeln;
write ('Элементы,которые больше 10, ');
if a[i] > 10 then write('a[',i,'] = ',a[i],' ');
writeln('Сумма элементов массива, кратных 4, равна ',s)
end.
===== PascalABC.NET =====
var n := 22;
var a := ArrRandom(n, 0, 12);
a[a.High] := 11;
a.Println;
var s := 0;
for var i := 0 to a.High do
if a[i] > 10 then
$'a[{i + 1}] = {a[i]} '.Print;
if a[i] mod 4 = 0 then
s += a[i]
Writeln;
Println('Сумма', s)
var a:array [1..22] of integer;
i,s:integer;
begin
write('Массив: ');
for i:=1 to 22 do
begin
a[i]:=random(13);
if i=22 then a[i]:=11;
write(a[i],' ');
if a[i] mod 4 = 0 then s:=s+a[i]
end;
writeln;
write ('Элементы,которые больше 10, ');
for i:=1 to 22 do
if a[i] > 10 then write('a[',i,'] = ',a[i],' ');
writeln;
writeln('Сумма элементов массива, кратных 4, равна ',s)
end.
===== PascalABC.NET =====
begin
var n := 22;
var a := ArrRandom(n, 0, 12);
a[a.High] := 11;
a.Println;
var s := 0;
for var i := 0 to a.High do
begin
if a[i] > 10 then
$'a[{i + 1}] = {a[i]} '.Print;
if a[i] mod 4 = 0 then
s += a[i]
end;
Writeln;
Println('Сумма', s)
end.