1.
. :
1) , ( );
2) , ( ).
2.
. , ( ). . , ( ).
3
. :
1) , ( );
2) , ( ).
4
. :
1) , ( );
2) , ( ).
5
. :
1) , ( );
2) , ( ).
6
ij, ij i- j- .
. :
1) , ( );
2) ( ).
7
1) 8x8 k, k- k- ( ).
2) , ( ).
8
1) . , ( ).
2) , ( ).
9
1) ij kl, i-1 £k£i+1, j-1£l£j+1, (k,l)¹(i,j). , . 1010 ( ).
2) , ( ).
|
|
10
1) , ( . 9). 1010 ( ).
2) , ( ).
11
1) . ( ).
2) , ( ).
12
1) , , ( ).
2) , ( ).
13
n ( ), n ( ).
14
×N k : , - , - , - ; - ( ).
15
1) . , ( ).
2) . , ( ).
16
1) ( ).
2) , ( ).
17
1) , , - (2, 2), - (3, 3) .., ( ).
2) , ( ).
18
. :
1) , ( );
2) , ( ).
19
. :
1) , ( );
2) , ( ).
20
ij, ij i- j- .
|
|
. :
1) , ( );
2) ( ).
- . Turbo Pascal :
Length(Z: String): Integer | Z |
Concat(Z1, [Z2,...,Zn]: String): String | () ZbZ2,...,Zn |
Copy(Z: String; Index: Integer; Count: Integer): String | Z Count, Index |
Pos(Substr: String; Z: String): Byte | 0, Z Substr - Substr Z |
Insert(Source: String; var Z: String; Index: Integer) | Z Source, Index |
Delete(var Z: String; Index, Count: Integer) | Z Count, - Index |
Str(N: [:Width[:Decimals]]; varZ: String) | N Z. N |
Val(Z; var N; var Code: Integer) | Z ( ) N. |
1. , . (, Pos ).
: . 6.1. Turbo Pascal :
Program max_diag;
Const Z: String='*?** *??***';
ch: Char='?';
i: Byte=0;
Begin
WriteLn(Z);
While Pos(ch,Z)<>0 do
Begin
{ }
WriteLn(Pos(ch,Z)+i);
{ }
Delete(Z,Pos(ch,Z),1);
{ }
Inc (i);
End;
WriteLn(Z);
ReadLn;
End.
. 6.1. - 1
2. , : 1) ; 2) .
: , ( ) .
. . ( ) , Delete Insert, .
. 6.2 . 6.3.
. 6.2. - 2 (1) | . 6.3. - 2 (2) |
1) Turbo Pascal :
Const z: String[24] = '\/\/\/\/\/\/\/\/\/\/';
old: Char='\'; new: Char='/';
Var i: Byte;
Begin
WriteLn(' : ':22,z);
For i:=l to Length(z) do
If z[i]=old
then z[i]:=new;
Write(' : ':22,z);
ReadLn;
End.
2) Turbo Pascal :
Const z: String=' ';
old: String[1]='';
new: String[3]='';
Var k,n: Byte;
Begin
n:=Length(old);
While Pos(old,z)<>0 do begin
k:=Pos(old,z);
Delete(z,k,n);
Insert(new,z,k);
end;
Write(' : ',z);
ReadLn;
End.
3. , () . , , . , z1,...,zn, , z1 = zn, z2=zn-1 ..
|
|
: Turbo Pascal :
Const z: String = ' ';
Var i,q: Byte;
Begin
z:=Concat(' ''',z, ''' ');
Write (' () ', z);
While Pos(' ',z)<>0 do
Delete(z,Pos(' ',z),l);
i:=l;
q:=Length(z);
While (i<=q div 2) and (z[i]=z[q+l-i]) do
Inc(i);
If i<=q div 2 then Write(' ');
Write(' ');
ReadLn;
End.
: z1 zn, z2 zn-1 ,... q div 2, q - . , .