...
...

II. -

  1. I. ̲. Բ (-) ̲
  2. -
  3. -
  4. ³
  5. 1. ?

- (H - ) (K - ), :

S, S1, ... ( ) , ( ) . () , (+), (-). : , , - . () . , - (1) - (5) S, S1... B.

-. - . - (1) - (5) ( ):

(1) begin S1; ...; Snend ( )
(2) if B then S1else S2 ( )
(3) if B then S ( )
(4) while B do S ( )
(5) repeat S1; ...; Snuntil B ( )

. - - -, - -, - -. ( , - - (1) - (5), S, S1, ... .)

. S- (2), (3)

(3 ') if B then begin S end

, - (6) (7):

if B1 then if B2 then S1 else S2.

- - gotoL ( ), L- ̳, , . , -, . 1,

1: S1; if B then begin S2; goto 1 end

if B1 then goto 2 else goto3; 2: S; 3: if B2 then goto2.

³, - - , "" , - , "". , - . 1 , . 2.

1. ( .) - (8) - 24) . 10 11, :

) ( (8) - (15));

) , , ( (16) - (21));

) , ( (22) - (24)).

2. ( -.) - (25) - (30) . 12 .

3. ( .) - (31) - (42) . 12 - 13. - .

4. (- .) - :

a) if B then begin S1; if B1then begin S2; S3end else ifB2thenS4end else ifB3then beginS5; S6; ifB4thenS7end;
) ifB then beginS1; repeatS2; S3untilB1end else ifB1thenS3elseS4; ifB2then begin ifB3then beginS1; S2; S3end elseS4; S5end else begin whileB4doS6; ifB5 thenS7; repeatS8untilB6; S9end;
) whileB do ifB1then S1; if B2then repeat S1; S2; S3untilB3; ifB4then repeatS4until B1else if B4then S5 else whileB5do beginS6; S7; S8; if B6then S9end.

5. ( .) - . - :

a) 5: if B1then begin S1; S2; S3end; 6: if B2then S4else goto 5; if B3then S5else if B4then S6else if B5then goto 6;
) 2: if B1then begin if B2then S1else while B3do S2; goto 1 end else if B4then S3else goto 2; 1: if B3then S4else S5;
) 2: S1; if B1then begin S2; if B2then repeat S3; S4until B3else if B4begin S5; S6; S7; S8; end end else if B7then S9else S10; 1: if B6then begin S11; goto 1 end else begin while B7do S12; goto 2 end; if B8then begin repeat S13until B9; goto 1 end.

6. ( .) , - (2), (4) (5) , (1) : x : = true x: = false ( x: = 0 x: = 1).





III. ʲ

. : ; ; .



  1   2   3   4   5   6   7   8   9   10  

| - 2006 | III.2. | IV.1. | IV.2. () | V. ˲ | ֲ ̲ |

...
© um.co.ua -