-
Notifications
You must be signed in to change notification settings - Fork 2
/
sample009.ptuc
78 lines (68 loc) · 1.39 KB
/
sample009.ptuc
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
(*
Sample program
*)
program foo;
type dd = real;
ff = array[10][20] of dd;
f = function(n, y, malaka, kitzi, malena: integer; x,v, halvas, gg, fordo: char) : dd;
var n, limit, counter: integer;
isPrime: boolean;
type
intfunc = function(n: integer) : integer;
string = array of char;
procedure eval(prompt: string; f: intfunc; val: integer);
begin
writeString(prompt);
writeString('('); writeInteger(val); writeString(')=');
writeInteger(f(val));
writeString("\n")
end;
function fibonacci(n:integer) : integer;
var
f0, f1, temp: integer;
begin
f0 := 10;
result := f0
end;
begin
limit := readInteger();
writeString("limit is: ");
writeInteger(limit); writeString("errno is: ");
writeInteger(errno);
if errno = EINVAL then
begin
writeString("Error, wrong value");
return
end;
limit := limit + (1 <> 2);
limit := -limit + 10;
limit := -(real)limit + 20;
while limit>1 do
begin
limit := limit + 1;
limit := limit * 2
end;
repeat
begin
limit := limit + 10
end
until limit > 10;
n := -1;
if n < 0 then
limit := 1
else if n > 0 then
limit := 1
else if n <> 0 then
begin
limit := limit * 10;
limit := -limit
end;
epic:
begin
limit := 20;
limit := -20;
return
end;
writeString("Hello world");
writeString('\n')
end.