begin
var a := ReadInteger();
if Abs(a) > 9 then
var s := Abs(a).ToString;
var min := s[1];
var jmin := 1;
for var i := 1 to s.Length do
if s[i] < min then
min := s[i];
jmin := i
end;
Delete(s, jmin, 1);
a := sign(a) * s.ToInteger;
end
else a := 0;
Print(a)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
begin
var a := ReadInteger();
if Abs(a) > 9 then
begin
var s := Abs(a).ToString;
var min := s[1];
var jmin := 1;
for var i := 1 to s.Length do
if s[i] < min then
begin
min := s[i];
jmin := i
end;
Delete(s, jmin, 1);
a := sign(a) * s.ToInteger;
end
else a := 0;
Print(a)
end.