第二章

第二&cce...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2 PL/0 PL/0 , 1 PL/0 2 PL/0 ( 3 PL/0 4 pcode 1. PL/0 PL/0 PL/0 p code ( PL/0 ) ( p code ) pascal/C) PL/0 p code pascal/C PL/0 p code p code PL/0 PL/0 PL/0 PL/0 PASCAL PL/0 PL/0 PL/0 EBNF PL/0 CONST A=10; * * VAR B,C; * * PROCEDURE P; * * VAR D; * P * PROCEDURE Q; * P * VAR X; BEGIN READ(X); D:=X; WHILE X#0 DO CALL P; END; BEGIN WRITE(D); CALL Q; END; BEGIN CALL P; END. Q p var r, h, len, a1, a2, volumn; begin read(r); read(h); len := 2 * 3 * r; a1 := 3 * r * r; a2 := a1 + a1 + len * h; volumn := a1 * h; write(len); write(a1); write(a2); write(volumn); end. var m, n, r, q; { m n } procedure gcd; begin while r#0 do begin q := m / n; r := m - q * n; m := n; n := r; end end; begin read(m); read(n); { m >= n } if m < n then begin r := m; m := n; n := r; end; begin r:=1; call gcd; write(m); end; end. pl/0 -- var n; procedure rec; begin if n # 0 then begin write(n); n := n - 1; call rec; end; end; begin read(n); call rec; end. sum = 1! + 2 ! + ... + n!, n var n, m, fact, sum; { fact = m! } procedure factorial; begin if m > 0 then begin fact := fact * m; m := m - 1; call factorial; end; end; begin {...
View Full Document

Page1 / 118

第二&cce...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online