Program n1; var a: array[1..15] of integer; sum,i: integer; begin randomize; write('исходный массив: '); sum:=0; for i:=1 to 15 do begin a[i]:=random(101); write(a[i],' '); if (a[i] mod 7=0) or (a[i] mod 17=0) then sum:=sum+a[i]; end; writeln; write('сумма: ',sum); end.
Answers & Comments
Verified answer
Program n1;var a: array[1..15] of integer;
sum,i: integer;
begin
randomize;
write('исходный массив: ');
sum:=0;
for i:=1 to 15 do
begin
a[i]:=random(101);
write(a[i],' ');
if (a[i] mod 7=0) or (a[i] mod 17=0) then
sum:=sum+a[i];
end;
writeln;
write('сумма: ',sum);
end.