- .
e
1. M x N, . .
1 , .
2 .
3 .
4 .
5 .
6 .
2. M x N, . .
1 , .
2 .
3 .
4 .
5 .
6 .
, For, While, Repeat. . :
For ;
While Repeat ;
, Repeat, ;
, , While, .
.
i=0..n |
j=0..k |
For For Forj=0 to k do { } For i=0 ton do { } ; |
i<=n
i:=i+1;
I:=I+1
j<=k
j:=0;
i:=0;
j=j+1
While While
j:=0;
Whilej<=k do { }
begin
i:=0:
While i<=n do { }
begin
;
i:=i+1:
end; { }
j:=j=1;
end;
i>n
j:=j+1
j:=0;
i:=0;
i:+i+1
j>k
Repeat Repeat
j=0;
Repeat
i=0;
repeat
;
i:=i+1;
until i>n;
j=j+1;
Until j>k;
j:=0
i=0..n
j:=j+1
j>k
Repeat For
j:=j+1;
Repeat
for i:=0 to n do
;
j:=j+1;
Until j>k;
1. TEdit
: LabeledEdit1.Text ;
;
Mx: T_M - (T_M = array of Real); Label1.Caption - i, Mx[i];
|
|
Mx.
.
LabeledEdit1.Text, S, , LabeledEdit1.Text[j] <> ' ')
j;
i;
S Val(S, Mx[i], Cod);
, , j <= Length(LabeledEdit1.Text.
True |
false |
: , i < |
true |
While |
Until |
Exit |
I=0, j=0 , Label.Caption |
if |
c |
. procedure TForm1.Button1Click(Sender: TObject) |
inc(j); j S:='' |
S Inc(j) |
false |
Val(S, Mx[i], Cod) |
Cod <> 0 |
i Mx[i] |
Inc(i) |
procedure TForm1.Button1Click(Sender: TObject);
Var Cod, i, j: Integer; //Cod -;
// i , j
S: String; // ,
Begin
i:=0; J:=0; //
Label1.Caption:= ''; //
Repeat //, Until . true
inc(j); // j 1, j=1
S:=''; //
{ j , }
While (LabeledEdit1.Text[j] <> ' ') and (j <= Length(LabeledEdit1.Text)) do
Begin
S:= S + LabeledEdit1.Text[j]; // S
Inc(j); //j 1, While
end; // While, S
Val(S, Mx[i], Cod);
// S Mx[i]
if Cod <> 0 //, Cod =0
then begin //
ShowMessage(' !');
Label1.Caption:= ''; //
exit; // Repeat
End;
{ . i, (#9), Mx[i], }
Label1.Caption:= Label1.Caption+
IntTostr(i)+#9+ FloatToStr(Mx[i])+#10#13;
inc(i); // i 1
{ i < j < Repeat }
Until (i>High(Mx)) or (j> Length(LabeledEdit1.Text)); // Repeat
End;
, , ,
type mat = array [0..5] of array [0..2] of Byte
:
type mat = array [0..5, 0..2] of Byte; , 6 [0..5] 3 [0..2].
|
|
cons t N=4; K=3;
type Vector = array [1..N, 1..K ] of Real; // 43}
var M_X: Vector; // 43}
M_Y: array [1.N, 0..K ] of Byte; // 44}
M_Z: array [ 1..4, 3..7 ] of Word;
, . , : array [1..3,1..3] of Byte, :
A[1,1] A[1,2] A[1,3] A[2,1] A[2,2] A[2,3] A[3,1] A[3,2] A[3,3]
:
var : array of array of Real; //
. ( ) , 2 . SetLength.
SetLength(var S; NewLength: Integer) - ,
S - ;
NewLength - S,
0.
nil Finalize.
N-1 (N - ) , , .