algol,n<
begin
comment
https://projecteuler.net/problem=12
Answer: 76576500
Time: 46087.41s = 12h 48m 7.41s
No buffer:
Time classic: 38157.34
Time turbo: 38153.31 0.01pct
Buffer:
Time classic: 38154.11
Time turbo: 38150.08 0.01pct
;
real clock;
real procedure clock count;
code clock count;
1, 37;
zl , grf p−1 ; RF ≔ clock count; stack[p−1] ≔ RF;
e;
integer i,j,triangle,ndivisor,max;
i ≔ 0;
select(16);
triangle ≔ 0;
for i ≔ 1 step 1 until 1000000000 do
begin
triangle ≔ triangle+i;
ndivisor ≔ 0;
max ≔ sqrt(triangle);
if max×max=triangle then ndivisor ≔ −1;
for j ≔ 1 step 1 until max do
begin
if triangle mod j=0 then ndivisor ≔ ndivisor+2;
end for;
if ndivisor>500 then goto found
end;
found:
clock ≔ clock count;
writecr;
writeinteger(«p»,triangle);
writecr;
write(«dddddddd.dd»,clock)
end;
t<