This is a simple calculator ( addition supported only ):
function calculate(s:string):string;
var sl:byte absolute s; {lenght of s}
a1,a2:real;
i:byte;
function to_val(si:string):real;
var r:real;
c:integer;
begin
val(si,r,c);
to_val:=r;
end;
begin
if sl>2 then begin {must at least 3 char long }
i:=pos('+',s); {only addition is supported}
if i=0 then s:='Syntax error' else begin
a1:=to_val(copy(s,1,i-1));
a2:=to_val(copy(s,i+1,sl-i));
str(a1+a2:6:4,s);
end;
end;
calculate:=s;
end;
begin
writeln(calculate('145+345'));
end.