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
85
86
| program raadsel;
uses dos,crt;
var
uurb,uure,minb,mine,secb,sece,sec100b,sec100e:word;
a,b,c,d,e,f,g,h,i,j:integer;
aba,cde,fba,de,gb,ha,fe,aeh,aaa,fa,cif,cdc,fdb,ccf:integer;
aeji: real;
hor1,hor2,hor3,vert1,vert2,vert3,diag:boolean;
begin
gettime(uurb,minb,secb,sec100b);
clrscr;
writeln('Berekening loopt...');
for a:=0 to 9 do
for b:=0 to 9 do
for c:=1 to 9 do
for d:=0 to 9 do
for e:=0 to 9 do
for f:=0 to 9 do
for g:=0 to 9 do
for h:=0 to 9 do
for i:=0 to 9 do
for j:=0 to 9 do
begin
if (a<>b) and (a<>c) and (a<>d) and (a<>e) and (a<>f) and (a<>g) and (a<>h) and (a<>i) and (a<>j)
and (b<>c) and (b<>d) and (b<>e) and (b<>f) and (b<>g) and (b<>h) and (b<>i) and (b<>j)
and (c<>d) and (c<>e) and (c<>f) and (c<>g) and (c<>h) and (c<>i) and (c<>j)
and (d<>e) and (d<>f) and (d<>g) and (d<>h) and (d<>i) and (d<>j)
and (e<>f) and (e<>g) and (e<>h) and (e<>i) and (e<>j)
and (f<>g) and (f<>h) and (f<>i) and (f<>j)
and (g<>h) and (g<>i) and (g<>j)
and (h<>i) and (h<>j)
and (i<>j)
then begin
aba:=a*101+b*10;
cde:=c*100+d*10+e;
fba:=f*100+b*10+a;
de:=d*10+e;
gb:=g*10+b;
ha:=h*10+a;
fe:=f*10+e;
aeh:=a*100+e*10+h;
aaa:=a*111;
fa:=f*10+a;
cif:=c*100+i*10+f;
cdc:=c*101+d*10;
aeji:=a*100+e*10+j+i/10;
fdb:=f*100+d*10+b;
ccf:=c*110+f;
hor1:=(aba+cde-fba=de);
hor2:=(gb+ha+fe=aeh);
hor3:=(aaa*c+fa=cif);
vert1:=(aba+gb+aaa=cdc);
vert2:=((cde+ha)/c=aeji);
vert3:=(fba+fe+fa=fdb);
diag:=(aba+ha+fa=ccf);
if hor1 and hor2 and hor3 and vert1 and vert2 and vert3 and diag
then begin
clrscr;
gettime(uure,mine,sece,sec100e);
writeln('Oplossing: ');
writeln('A = ',a);
writeln('B = ',b);
writeln('C = ',c);
writeln('D = ',d);
writeln('E = ',e);
writeln('F = ',f);
writeln('G = ',g);
writeln('H = ',h);
writeln('I = ',i);
writeln('J = ',j);
writeln('Rekentijd: ',uure-uurb,' uur, ',mine-minb,' minuten, ',sece-secb,',',sec100e-sec100b,' seconden.');
writeln('Druk op een toets.');
repeat until keypressed;
exit;
end;
end;
end;
gettime(uure,mine,sece,sec100e);
clrscr;
writeln('Geen oplossing gevonden.');
writeln('Rekentijd: ',uure-uurb,' uur, ',mine-minb,' minuten, ',sece-secb,',',sec100e-sec100b,' seconden.');
writeln('Druk op een toets.');
repeat until keypressed;
end. |