procedure TForm1.Button1Click(Sender: TObject);
type
num=record
s:string;
l:integer;
end;
function rever(s:string):string;
var
i:integer;
s1:string;
begin
s1:='';
for i:=0 to length(s)-1 do
s1:=s1+s[length(s)-i];
rever:=s1;
end;
var
a1, a2, b:num;
i,j, buf, max, sum:integer;
c1,c2:char;
begin
a1.s:=edit1.Text;
a2.s:=edit2.Text;
a1.l:=length(a1.s);
a2.l:=length(a2.s);
b.s:='';
if a1.l>a2.l then max:=a1.l else max:=a2.l;
buf:=0;
for i:=0 to max-1 do
begin
if a1.l<=i then c1:='0' else c1:=a1.s[a1.l-i];
if a2.l<=i then c2:='0' else c2:=a2.s[a2.l-i];
sum:=strtoint(c1)+strtoint(c2)+buf;
if sum>9 then
begin
buf:=1;
sum:=sum-10;
end
else
buf:=0;
b.s:=b.s+inttostr(sum);
end;
if buf=1 then b.s:=b.s+'1';
edit3.Text:=rever(b.s);
end;