fork download
  1. program ideone;
  2.  
  3. function Reverse(N, p:LongInt):LongInt;
  4. begin
  5. if N<=0 then Reverse := p
  6. else Reverse := Reverse(N div 10, p*10+(n mod 10))
  7. end;
  8.  
  9. var i : LongInt;
  10. begin
  11. i:=57918;
  12. WriteLn(Reverse(i,0))
  13. end.
Success #stdin #stdout 0s 336KB
stdin
Standard input is empty
stdout
81975