{ Autor: Dipl.-Ing. Thomas Speiser        }
{ Source from: http://Codes.TurboTools.de }

program quersumme_rekursiv;
uses Crt;
{$S-}
var i: integer;

function qs(n: integer): integer;
begin
if n < 10 then qs:=n else qs:=qs(n div 10) + (n mod 10)
end;

begin
ClrScr;
write('Zahl eingeben: ');
readLN(i);
write('Die Quersumme ist: ',qs(i));
readLN;
end.