program mas;
uses crt;
var
i,pol,otr,nul:integer;
x:array[1..100]of real;
n:integer;
begin
writeln('vvedite n');
readln(n);
otr:=0;
pol:=0;
nul:=0;
for i:=1 to n do begin
readln(x[i]);
if x[i]<0 then otr:=otr+1;
if x[i]>0 then pol:=pol+1;
if x[i]=0 then nul:=nul+1;
end;
writeln('polojit',pol);
writeln('otricat',otr);
writeln('nulev',nul);
readln;
end.
Объяснение:
--- PascalABC.NET 3.6.2 ---
var (neg, pos) := (0, 0);
var n := ReadInteger();
ArrRandomReal(n, -99, 99).Println.ForEach(p -> begin if (p < 0) then neg += 1 else pos += 1 end);
Print($'Positive numbers: {pos}; Negative: {neg}');
program mas;
uses crt;
var
i,pol,otr,nul:integer;
x:array[1..100]of real;
n:integer;
begin
writeln('vvedite n');
readln(n);
otr:=0;
pol:=0;
nul:=0;
for i:=1 to n do begin
readln(x[i]);
if x[i]<0 then otr:=otr+1;
if x[i]>0 then pol:=pol+1;
if x[i]=0 then nul:=nul+1;
end;
writeln('polojit',pol);
writeln('otricat',otr);
writeln('nulev',nul);
readln;
end.
Объяснение:
--- PascalABC.NET 3.6.2 ---
begin
var (neg, pos) := (0, 0);
var n := ReadInteger();
ArrRandomReal(n, -99, 99).Println.ForEach(p -> begin if (p < 0) then neg += 1 else pos += 1 end);
Print($'Positive numbers: {pos}; Negative: {neg}');
end.
Объяснение: