TPK algorithm: Difference between revisions

Content deleted Content added
Perl golf: 73->79. published a wrong code.
The algorithm: reformat Algol code
Line 9:
 
<code>
'''begin'''
'''integer''' i;
'''real''' y;
'''real array''' a[0:10];
'''real procedure''' f(t); '''real''' t; '''value''' t;
f'''real :=procedure''' sqrt(absf(t))+5*t^3;
'''for''' i := 0 '''step''' 1 '''untilreal''' 10t; '''dovalue''' read(a[i])t;
'''for''' i := 10 '''step'''f -1:= '''until'''sqrt(abs(t)) 0+ '''do'''5*t^3;
'''begin''' y := f(a[i]);
'''for''' i := 0 '''ifstep''' y > 4001 '''thenuntil''' write(i,10 "TOO LARGE")'''do'''
'''else''' writeread(a[i,y]);
'''for''' i := 10 '''step''' -1 '''until''' 0 '''do'''
'''end'''
'''begin''' y := f(a[i]);
'''if''' y > 400 '''then'''
write(i, "TOO LARGE")
'''else'''
write(i, y);
'''end'''
'''end'''
</code>