-
Notifications
You must be signed in to change notification settings - Fork 0
/
routines.pas
executable file
·84 lines (62 loc) · 1.4 KB
/
routines.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
PROGRAM RoutinesTest(input, output);
CONST
five = 5;
TYPE
enum = (alpha, beta, gamma);
arr = ARRAY [1..five] OF real;
VAR
e, k : enum;
i, m : integer;
a : arr;
v, y : real;
t : boolean;
PROCEDURE proc(j, k : integer; VAR x, y, z : real; VAR v : arr;
VAR p : boolean; ch : char);
VAR
i : real;
BEGIN
i := 7*k;
x := 3.14;
END;
FUNCTION forwarded(m : integer; VAR t : real) : real; forward;
FUNCTION func(VAR x : real; i : real; n : integer) : real;
VAR
z : real;
p, q : boolean;
PROCEDURE nested(VAR n, m : integer);
CONST
ten = 10;
TYPE
subrange = five..ten;
VAR
a, b, c : integer;
s : subrange;
PROCEDURE deeply;
VAR
w : real;
BEGIN
w := i;
nested(a, m);
w := forwarded(b, w);
END;
BEGIN {nested}
s := m;
deeply;
a := s;
END {nested};
BEGIN {func}
p := true;
q := false;
x := i*z - func(v, -3.15159, five) + n/m;
func := x;
END {func};
FUNCTION forwarded;
VAR
n : integer;
BEGIN
forwarded := n*y - t;
END;
BEGIN {RoutinesTest}
e := beta;
proc(i, -7 + m, a[m], v, y, a, t, 'r');
END {RoutinesTest}.