-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeUltimateTest.pas
73 lines (67 loc) · 1.31 KB
/
theUltimateTest.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
Program theUltimateTest (input,output);
{
This file may contain some INTENTIONAL BUGS to test your compiler.
As they are encountered, you should fix them and re-run until the
program runs.
}
Var
h,z,i,x,y : integer;
w : array [1..5] of integer;
rl : real;
function gcd (a, b : integer) : result integer;
var x : integer;
begin
if (b = 0) then gcd := a
else begin
x := a;
while (x >= b) do
begin
x := x - b
end;
gcd := gcd(b,x)
end
end
procedure this (why : integer; note : real);
begin
{ The comparison checks how you handle arithmetic
and comparisons with mixed type numbers }
if ((why = note - 1608) or (not (note = why)))
then if (x - y = 0)
then begin
w[i] := why DIV note
end
end
procedure that;
var h : integer;
z : real;
begin
h := 1;
z := 7.43;
x := y;
this (h,z)
end
begin
i := 1;
x := 5;
While (I <= 5) and (x <= 75) do
begin
w [i] := x;
w[x] := w[i] * 20;
i := i + 1
end;
read (x,y);
if x>y then write (gcd(x, y)) else write (gcd (h,z));
w[x] := 6758;
rl := 23e10;
write(w[x]);
this (gcd(x,y),rl);
this (w[x],rl);
that;
i := 1;
while (i <= 5) do
begin
write(w[i]);
i := i + 1
end;
write(h,i,x,y,z)
end.