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

19 lines
387 B
Plaintext

include c:\cxpl\codes;
func real F(X);
real X;
return sqrt(abs(X)) + 5.0*X*X*X;
real Result, S(11); int I;
[Text(0, "Please enter 11 numbers: ");
for I:= 0 to 11-1 do S(I):= RlIn(0);
for I:= 11-1 downto 0 do
[RlOut(0, S(I));
Result:= F(S(I));
if Result > 400.0 then
Text(0, " overflows")
else RlOut(0, Result);
CrLf(0)];
]