Если заработает, скажите, пожалуйста, хочется хоть что-нибудь отметить
var
a: string;
i, j, g, err, res: integer;
bo, ol: boolean;
begin
readln(a);
a := '+' + a + '=';
for i := 1 to length(a) do
begin
val(a[i], g, err);
if (err = 0) then
j := j * 10 + g
else
begin
if (ol) then
if (bo) then
res := res + j
else
res := res - j;
bo := a[i] = '+';
ol := true;
j := 0;
end;
end;
writeln(res);
end.