Program ds;
var s: string;
procedure doWork(var s: string);
var
i: integer;
l: integer;
begin
i := 1;
l := length(s);
while (i < l) and ((s[i] < 'z') and (s[i] > 'a') or (s[i] < 'Z') and (s[i] > 'A')) do
inc(i);
if (i > 1) and (i < l) then
begin
while (i < l) and ((s[i] < 'z') and (s[i] > 'a') or (s[i] < 'Z') and (s[i] > 'A')) do
inc(i);
if (i > 1) and (i < l) then
for i:=1 to l do
begin
if s[i] = '+' then
s[i] := '1';
if s[i] = '-' then
s[i] := '2';
if s[i] = '*' then
s[i] := '3'
end;
end;
end;
begin
readln(s);
doWork(s);
writeln(s);
end.
М | Тэги, тэги, тэги!.. |
Сообщение отредактировано: Lapp -