RosettaCodeData/Task/Trabb-Pardo-Knuth-algorithm/Agena/trabb-pardo-knuth-algorithm.agena

14 lines
343 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
scope # TPK algorithm in Agena
local y;
local a := [];
2026-02-01 16:33:20 -08:00
local proc f( t :: number ) :: number return sqrt(abs(t))+5*t*t*t end;
2023-07-01 11:58:00 -04:00
for i from 0 to 10 do a[i] := tonumber( io.read() ) od;
for i from 10 to 0 by - 1 do
y:=f(a[i]);
if y > 400
then print( "TOO LARGE" )
else printf( "%10.4f\n", y )
fi
od
2026-02-01 16:33:20 -08:00
end