Program n1; Uses Crt; Var c: array[1..1000] of integer; n, i, null, otric, polozhit :integer; Begin writeln('Razmer massiva = '); Readln(n);
for i:=1 to n do begin c[i]:=random(40) - 20; write(c[i]:4); end;
writeln();
otric:=0; polozhit:=0; null:=0; for i:=1 to n do begin if (c[i]<0) then otric:=otric+1; if (c[i]>0) then polozhit:=polozhit+1; if (c[i]=0) then null:=null+1; end; writeln('Kol-vo chisel < 0: ', otric); writeln('Kol-vo chisel > 0: ', polozhit); writeln('Kol-vo chisel = 0: ', null); End.
Type mas = array[1..8] of integer; var A, F, Q: mas; C:array[1..8] of real; i: integer; function M(x,y:real):real; begin Result:=(x*x+y*x)/2+sin(x*y) end; begin clrscr; writeln('Массив первый:'); for i := 1 to 8 do begin A[i] := random(10); write(A[i]:4); end; writeln; writeln('Массив второй :'); for i := 1 to 8 do begin F[i] := random(10) ; write(F[i]:4); end; writeln; writeln('Массив третий :'); for i := 1 to 8 do begin Q[i] := random(10); write(Q[i]:4); end; writeln; writeln('Массив четвертый:'); for i := 1 to 8 do begin C[i] := M(A[i],F[i])+M(Q[i],F[i])+M(A[i],Q[i]); write(C[i]:6:1); end; writeln; end.
Uses Crt;
Var
c: array[1..1000] of integer;
n, i, null, otric, polozhit :integer;
Begin
writeln('Razmer massiva = '); Readln(n);
for i:=1 to n do begin
c[i]:=random(40) - 20;
write(c[i]:4);
end;
writeln();
otric:=0; polozhit:=0; null:=0;
for i:=1 to n do begin
if (c[i]<0) then otric:=otric+1;
if (c[i]>0) then polozhit:=polozhit+1;
if (c[i]=0) then null:=null+1;
end;
writeln('Kol-vo chisel < 0: ', otric);
writeln('Kol-vo chisel > 0: ', polozhit);
writeln('Kol-vo chisel = 0: ', null);
End.
var
A, F, Q: mas;
C:array[1..8] of real;
i: integer;
function M(x,y:real):real;
begin
Result:=(x*x+y*x)/2+sin(x*y)
end;
begin
clrscr;
writeln('Массив первый:');
for i := 1 to 8 do
begin
A[i] := random(10);
write(A[i]:4);
end;
writeln;
writeln('Массив второй :');
for i := 1 to 8 do
begin
F[i] := random(10) ;
write(F[i]:4);
end;
writeln;
writeln('Массив третий :');
for i := 1 to 8 do
begin
Q[i] := random(10);
write(Q[i]:4);
end;
writeln;
writeln('Массив четвертый:');
for i := 1 to 8 do
begin
C[i] := M(A[i],F[i])+M(Q[i],F[i])+M(A[i],Q[i]);
write(C[i]:6:1);
end;
writeln;
end.