Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- x: longint;
- min, max: byte;
- begin
- Write('Введите целое число: ');ReadLn(x);
- min := x mod 10;
- max := x mod 10;
- while x <> 0 do
- begin
- x := x div 10;
- if x mod 10 < min then min := x mod 10;
- if x mod 10 > max then max := x mod 10;
- end;
- WriteLn('Ответ: ', min + max);
- end.
Add Comment
Please, Sign In to add comment