const cf=['0'..'9']; var s: string; i,sum,t,c: integer; beginwriteln('vvedite posledovatelnost liter: '); readln(s); val(s[1],t,c); sum: =t; for i: =2 to length(s)-1 do begin if (s[ i ] in cf)and(s[i-1]='+')then begin val(s[ i ],t,c); sum: =sum+t; end else if (s[ i ] in cf)and(s[i-1]='-')then begin val(s[ i ],t,c); sum: =sum-t; end; end; writeln('sum=',sum); end.
const cf=['0'..'9']; var s: string; i,sum,t,c: integer; beginwriteln('vvedite posledovatelnost liter: '); readln(s); val(s[1],t,c); sum: =t; for i: =2 to length(s)-1 do begin if (s[ i ] in cf)and(s[i-1]='+')then begin val(s[ i ],t,c); sum: =sum+t; end else if (s[ i ] in cf)and(s[i-1]='-')then begin val(s[ i ],t,c); sum: =sum-t; end; end; writeln('sum=',sum); end.