Alex_Fomin

Untitled

Feb 16th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.33 KB | None | 0 0
  1. var
  2.   x: longint;
  3.   min, max: byte;
  4.  
  5. begin
  6.   Write('Введите целое число: ');ReadLn(x);
  7.   min := x mod 10;
  8.   max := x mod 10;
  9.   while x <> 0 do
  10.   begin
  11.     x := x div 10;
  12.     if x mod 10 < min then min := x mod 10;
  13.     if x mod 10 > max then max := x mod 10;
  14.   end;
  15.   WriteLn('Ответ: ', min + max);
  16. end.
Add Comment
Please, Sign In to add comment