.
If < 1> then begin
If < 2> then < 1>;
End
Else < 2>;
.
I) FOR
For < >:=< > to (downto) < > do <>;
, , - .
For i:=5 to 8 do {4 }
= + 1 {i:Word,Byte,Integer,Long/ShortInt,char}
For ch:= a to d do {4 }
For b:= false to true do {2 }
For i:=3.5 to 5.5 do { .. }
:
1)
2)
for i:=5 to 8 do
a:=b+c;
write(i);{7,8,9}
1 .
For i:=5 to 8 do
i:=i+1;
For i:=i+10 to i-1 do
II)
While < > do <>;
III)
Repeat
<>
Until < >;
1 .
Repeat until false; - .
, (begin end;)( ).
.
Case < > of
< >: <>;
< >: <>;
[else <>];
End;
{ }
Var ch: char;
{ }
Case ch of
,,: write( );
0..9: write();
A..Z, ..ߒ: write( );
., ;, :, !: begin
Writeln( );
Write( ..);
End;
Else write( , , );
End;
.
, 1.
string .
(..).
.
{ }
(* *)
(* {} *)
{ (*} *)
(* *)
.
. .
Array [< >..< >] of < >;
, .
a[1]
a[i]
a[n]
, .
a[i,j], i , j .
, . .
|
|
a[1,5] 1 , 5 , a[i,j] i , j .
max | |
max |
max | |
max | |
{ }
For j:=1 to m-1 do begin
Max:=a[j]; { 1 }
imax:=j;
for i:=j+1 to m do
if a[i]>max then begin
max:=a[i];
imax:=i;
end;
{1} v:=a[j]; { }
a[j]:=a[imax];
a[imax]:=v;
end;
{2} a[imax]:=a[j];
a[j]:=max;
{1} 1 2 max ({2}).