Program p1; Const N=10; Var A:array[1..N] of integer; proizvedenie,i:integer; Begin proizvedenie:=1; For i:= 1 to n do Begin A[i]:=random(101)-50; Write(A[i],' '); End; Writeln; For i:= 1 to n do If a[i]<0 then proizvedenie:=proizvedenie*A[i]; Writeln('Произведение = ', proizvedenie); End.
Program p2; Const N=10; Var A:array[1..N] of integer; kolvo,i:integer; Begin For i:= 1 to n do Begin A[i]:=random(101)-50; Write(A[i],' '); End; Writeln; For i:= 1 to n do If a[i] mod 3=0 then kolvo:=kolvo+1; Writeln('Кратных трём элементов ',kolvo, ' штук'); End.
Program p1;
Const N=10;
Var A:array[1..N] of integer;
proizvedenie,i:integer;
Begin
proizvedenie:=1;
For i:= 1 to n do
Begin
A[i]:=random(101)-50;
Write(A[i],' ');
End;
Writeln;
For i:= 1 to n do
If a[i]<0 then
proizvedenie:=proizvedenie*A[i];
Writeln('Произведение = ', proizvedenie);
End.
Program p2;
Const N=10;
Var A:array[1..N] of integer;
kolvo,i:integer;
Begin
For i:= 1 to n do
Begin
A[i]:=random(101)-50;
Write(A[i],' ');
End;
Writeln;
For i:= 1 to n do
If a[i] mod 3=0 then
kolvo:=kolvo+1;
Writeln('Кратных трём элементов ',kolvo, ' штук');
End.
program massiv;
var
a,b,i,n,d,e,s:integer;
m:array[1..n] of integer;
begin
readln(n);
for i:=1 to n do
readln(m[i]);
a:=1;
b:=0;
for i:=1 to n do
begin
if m[i]<0 then a:=a*m[i];
if (m[i] mod 3 = 0) then b:=b+1;
end;
writeln(a,' ',b);
end.