- .
, - .
, .
, , . .
. , ,
"A", A[1], A[2] . .
. ,
,
. ().
. ,
, - .
.
, .
.
, .
.
, ,
. "A"
(). -
. "S"
. , -
. :
|
|
|
1 |
|
5 |
2 |
|
4 |
3 |
|
5 |
4 |
|
5 |
... |
... |
... |
30 |
|
4 |
:
Var A : array[1..30] of byte;
S : array[1..30] of string; {}
SO: array[1..30] of string[12];
:
"A" - A[1]:= 5; A[2]:= 4; . .
"S " - S[1]:= ''; S[2]:= ''; . .
,
:
|
1 |
2 |
3 |
4 |
1 |
30 |
"S" |
S[ 1 ] |
S[ 2 ] |
S[ 3 ] |
S[ 4 ] |
S[ i ] |
S[ 30 ] |
|
|
|
|
|
... |
|
"A" |
A[ 1 ] |
A[ 2 ] |
A[ 3 ] |
A[ 4 ] |
A[ i ] |
A[ 30 ] |
|
5 |
4 |
5 |
5 |
... |
4 |
,
,
c . ,
"y" : y=sin(x), x= Pi * i/180, 0<= i <=180.
For i:= 0 to 180 Do y[i]:= sin(Pi * i/180);
-30 +40
"R":
Randomize;
for i:= 1 to 100 Do R[i]:= - 30 + Random(71);
"A" Readln:
For i:= 1 to 7 Do
begin
Write(' A[',i,']= ');
Readln(A[i]);
end;
- . ("
") , :
For j:=1 to 66 do Write('-'); Writeln;
For j:=1 to 3 do Write('| | |'); Writeln;
For j:=1 to 66 do Write('-'); Writeln;
- "S" "A".
66 ( 79
). Writeln; .
"S" "A"
, :
For i:= 1 to 100 do
begin
Write('|', s[i]:11,'|', a[i]:8, '|');
if (i mod 3) = 0 Then Writeln;
if (i mod 60) = 0 then Readln;
end;
,
Readln , , 20 .
,
() ,
, :
s := 0;
for i := 1 to 100 do s:= s + a[i]; { s - }
a_max := a[1];
for i:= 1 to 100 do { a[j] }
if a[i] > a_max then begin a_max:= a[i]; j:= i; end;
j := 0; k := 0;
for i:=1 to 100 do { : b[j]>=0, c[k]<0}
if a[i] >= 0 then
begin
j := j+1;
b[j] := a[i];
end
else
begin
k := k+1;
c[k] := a[i]
end;
j := 0;
k := 8;
for i:= 1 to 100 do { "M" : a[i] > a[k]}
if a[i] > a[k] then
begin
j := j+1;
M[j] := i;
end;
, , ,
. , . .
, .
- -
, :
Var
A: array[1..30, 1..7] of byte;
.
.
"A" (
).
, - , .
: a[i, j]
I- J- .
:
:
|
1 |
2 |
3 |
4 |
5 |
6 |
|
|
|
|
|
|
|
|
1 |
|
4 |
5 |
3 |
4 |
5 |
5 |
2 |
|
4 |
5 |
4 |
3 |
4 |
4 |
3 |
|
5 |
5 |
3 |
4 |
5 |
4 |
... |
... |
... |
... |
... |
... |
... |
... |
30 |
|
4 |
3 |
4 |
5 |
4 |
5 |
"S"
"P" . ""
, - , : 1 -
, 2 - , 3 - , 4 - , 5 - , 6 - .
( = N, = M ):
"I" |
"J" |
1 |
2 |
3 |
4 |
... |
J |
... |
M |
"S" |
"P" |
P[1] |
P[2] |
P[3] |
P[4] |
... |
P[J] |
... |
P[M] |
1 |
S[1] |
"A" |
a[1, 1] |
a[1, 2] |
a[1, 3] |
a[1, 4] |
... |
a[1, j] |
... |
a[n, m] |
2 |
S[2] |
a[2, 1] |
a[2, 2] |
a[2, 3] |
a[2, 4] |
... |
a[2, j] |
... |
a[2, m] |
3 |
S[3] |
a[3, 1] |
a[3, 2] |
a[3, 3] |
a[3, 4] |
... |
a[3, j] |
... |
a[3, m] |
4 |
S[4] |
a[4, 1] |
a[4, 2] |
a[4, 3] |
a[4, 4] |
... |
a[4, j] |
... |
a[4, m] |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
I |
S[I] |
a[i, 1] |
a[i, 2] |
a [i, 3] |
a [i, 4] |
... |
a[i, j] |
... |
a[i, m] |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
N |
S[N] |
a[n, 1] |
a[n, 2] |
a[n, 3] |
a[n, 4] |
... |
a[n, j ] |
... |
a[n, m] |
Random,
:
for i:= 1 to N do
for j:= 1 to M do A[i, j]:= random(4) + 2;
( "" )
:
Writeln;
Write('\\:|');
For i:= 1 to M do write(P[i]:9,' |');
"A" :
for i:= 1 to N do
begin
writeln;
write(S[i]:19, ' |';
for j:= 1 to M do write(A[i,j]:7, ' |')
end;
"SS" - "M"
"N" "A" (NxM) :
for i:= 1 to N do
begin
SS[i]:= 0;
for j:= 1 to M do SS[i]:= SS[i] + A[i,j];
end;
"i" 1 N
A[i, j] "j" 1 M.
"A"
, ,
"B" "M1" J
>= M1 :
for i:= 1 to N do
begin
for j:=M+1 downto M1+1 do A[i,j]:=A[i,j-1];
A[i,M1]:=B[i];
end;
,
"A", ,
:
for j:= 1 to N do
begin
a1:=A[1,j];
A[1,j]:=A[2,j];
A[2,j]:=a1;
end;
: "A"
, ,
"P" "S".
. ,
"" "A" :
for j:= 1 to M do
If (j Mod 2) = 0 then for i:= 1 to N do B[i,j Div 2]:= A[i,j];
"",
"A", A[i, 1] > C, C - ,
:
k:= 0;
for i:= 1 to N do
If A[i,1] > C then
begin
k:= k + 1;
for j:= 1 to M do B[k,j]:= A[i,j];
end;
(). , "N"
"SS"
:
k:= 30/S_max; { k - }
{ S_max - "SS" }
for i:=1 to N do
begin
writeln; { }
yg := round(k*SS[i]); { yg - }
for j:=1 to yg do write(#220); { '_' 220 }
end;
SS[i] :
|