var
a : array[1..10] of integer;
i, p : integer;
begin
p := 1;
for i := 1 to 10 do
a[i] := round(random(11));
Write(a[i], ', ');
p := p * a[i];
end;
WriteLn();
WriteLn('Произведение равно ', p);
end.
Объяснение:
const n=10;
var a:array[1..n] of integer;
i:integer; p:real;
for i:=1 to n do read(a[i]);
p:=1;
for i:=1 to n do p:=p*a[i];
writeln('p = ',p);
Пример:
4 6 2 3 8 1 4 7 9 1
p = 290304
var
a : array[1..10] of integer;
i, p : integer;
begin
p := 1;
for i := 1 to 10 do
begin
a[i] := round(random(11));
Write(a[i], ', ');
p := p * a[i];
end;
WriteLn();
WriteLn('Произведение равно ', p);
end.
Объяснение:
const n=10;
var a:array[1..n] of integer;
i:integer; p:real;
begin
for i:=1 to n do read(a[i]);
p:=1;
for i:=1 to n do p:=p*a[i];
writeln('p = ',p);
end.
Пример:
4 6 2 3 8 1 4 7 9 1
p = 290304