var
a, max, t:integer;
begin
write('Введите число '); readln(a);
max := abs(a mod 10 - (a mod 100) div 10);
while a div 10 <> 0 do
t := a div 10;
while t <> 0 do
if abs(t mod 10 - a mod 10) > max then
max := abs(t mod 10 - a mod 10);
t := t div 10;
end;
a := a div 10;
writeln('Max = ', max);
end.
var
a, max, t:integer;
begin
write('Введите число '); readln(a);
max := abs(a mod 10 - (a mod 100) div 10);
while a div 10 <> 0 do
begin
t := a div 10;
while t <> 0 do
begin
if abs(t mod 10 - a mod 10) > max then
max := abs(t mod 10 - a mod 10);
t := t div 10;
end;
a := a div 10;
end;
writeln('Max = ', max);
end.