Var
N, Na, Kolvo, SrSum, Summa, I: Integer;
Z: array [1.. 20] of Integer;
A: array [1.. 20] of Integer;
Begin
Writeln(' ');
Writeln(' N <= 20');
Readln (N);
Writeln(' - ');
For I:= 1 to N do
Readln (Z [I]);
Writeln(' ');
For I:= 1 to N do
Write (Z [I]: 3);
Writeln;
Na:= 0;
For I:= 1 to N do
IfZ [I] < 0 Then
Begin
Summa:= Summa + Z [I];
Kolvo:= Kolvo + 1;
end;
IfKolvo > 0 Then
Begin
SrSum:= Round (Summa/Kolvo);
Na:= 0;
For I:= 1 to N do
If Z [I] <= SrSum Then
Begin
Na:= Na + 1;
A [Na]:= Z [I];
end;
IfNa > 0 Then
Begin
Writeln(' ');
For I:= 1 to Na do
Write (A [I]: 3);
Writeln
End
Else
Writeln(' , ')
End
Else
Writeln(' ');
End.
3.
Var
I: integer;
Ch,Zn,Summa,S1,S2,x,eps: real;
Begin
Write('X=');
Readln(X);
Writeln;
Write('Eps=');
Readln(Eps);
Writeln;
I:=1; { }
Ch:= x-1;{ }
Zn:= x;{ }
Summa:=1;{ }
S2:=0;{ i- }
S1:= ch/zn;{ i-1 - }
Repeat
S2:= S1;
Summa:= Summa + S2;
Ch:= Ch*(X-1);
Zn:= Zn*x*(I + 1);
S1:= ch/zn;
Writeln('S1=', Ch,'/',Zn);
I:=I+1;
Writeln(' ', S1:6:2);
Writeln('IS1-S2I',Abs(S1-S2):10:4);
Until Abs(S1-S2)<=Eps;
Writeln(' ',Summa);
End.
1
8
1. X[1:n]. .
Var
n,i,j,k,l:integer;
a,s,c,x: array [1..20] of integer;
srar:real;
Begin
n:=0;
Writeln(' ');
Writeln(' <=20');
readln(n);
writeln(' - ');
for i:=1 to n do begin
writeln('x[',i,']=');
read(x[i]);
end;
writeln(' ');
for i:=1 to n do
write (x[i]:7);
i:=1;
J:=0;
k:=0;
While (x[i]<=0) and (i<=n) do begin
i:=i+1;
End;
If (i<=n) then begin
j:=i;
i:=n;
While (x[i]<=0) and (i<=n) do begin
i:=i-1;
end;
k:=i;
srar:=(x[j]+x[k])/2;
Writeln;
Writeln(' (',x[j],') (',x[k],') ',srar) end
else begin Writeln;
Writeln(' ')
end;
end.
2. Z[1:n]. , .
Var
n,i,j,k,l,imin,kol:integer;
|
|
a,s,c,z: array [1..20] of integer;
min:real;
Begin
n:=0;
Writeln(' , . ');
Writeln(' <=20');
readln(n);
writeln(' - ');
for i:=1 to n do begin
writeln('z[',i,']=');
read(z[i]);
end;
writeln(' ');
for i:=1 to n do
write (z[i]:7);
Min:=z[1];
For i:=1 to n do
Ifz[i]<min then
min:=z[i];
Kol:=0;
For i:=n downto 1 do