1. Ввод с клавиатуры var p,i:integer; a:array [1..10] of integer;
begin p:=-1;
for i:=1 to 10 do begin readln (a [i]); end;
while p = -1 do begin for i:=1 to 10 do begin if (a [i] < 3) then p:=1; end; end;
for i:=1 to 10 do begin if (a [i] < 3) then p:=p*a [i]; end; writeln (p); end.
2.Рандом
var p,i:integer; a:array [1..10] of integer;
begin p:=-1;
for i:=1 to 10 do begin a [i]:=Random (10); end; write ('Наш массив: '); for i:=1 to 10 do begin write (a [i]); write (' '); end; writeln (' '); while p = -1 do begin for i:=1 to 10 do begin if (a [i] < 3) then p:=1; end; end;
for i:=1 to 10 do begin if (a [i] < 3) then p:=p*a [i]; end; writeln ('Произведение = ',p); end.
var
p,i:integer;
a:array [1..10] of integer;
begin
p:=-1;
for i:=1 to 10 do begin
readln (a [i]);
end;
while p = -1 do begin
for i:=1 to 10 do begin
if (a [i] < 3) then p:=1;
end;
end;
for i:=1 to 10 do begin
if (a [i] < 3) then
p:=p*a [i];
end;
writeln (p);
end.
2.Рандом
var
p,i:integer;
a:array [1..10] of integer;
begin
p:=-1;
for i:=1 to 10 do begin
a [i]:=Random (10);
end;
write ('Наш массив: ');
for i:=1 to 10 do begin
write (a [i]);
write (' ');
end;
writeln (' ');
while p = -1 do begin
for i:=1 to 10 do begin
if (a [i] < 3) then p:=1;
end;
end;
for i:=1 to 10 do begin
if (a [i] < 3) then
p:=p*a [i];
end;
writeln ('Произведение = ',p);
end.