var
k1,k2,k3,i,n: integer;
a: array [1..100] of integer;
begin
write('n=');
readln(n);
k1:=0;k2:=0;k3:=0;
for i := 1 to n do
write('a[i]:= ');
readln(a[i]);
end;
for i:=1 to n do
if(a[i]<0) then k1:=k1+1 else
if(a[i]>0) then k2:=k2+1;
if(a[i]=0) then k3:=k3+1 else
writeln('Otricatelnih= ',k1, ' polozhitelnih= ',k2, ' ravnih nulu= ',k3);
readln;
end.
Объяснение:
э
var
k1,k2,k3,i,n: integer;
a: array [1..100] of integer;
begin
write('n=');
readln(n);
k1:=0;k2:=0;k3:=0;
for i := 1 to n do
begin
write('a[i]:= ');
readln(a[i]);
end;
for i:=1 to n do
begin
if(a[i]<0) then k1:=k1+1 else
if(a[i]>0) then k2:=k2+1;
if(a[i]=0) then k3:=k3+1 else
end;
writeln('Otricatelnih= ',k1, ' polozhitelnih= ',k2, ' ravnih nulu= ',k3);
readln;
end.
Объяснение:
э