allekco

палиндром

Oct 24th, 2019
19
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2. num, a, c, n: integer;
  3. begin
  4. readln(num);
  5. if num div 100 = num mod 10 then writeln('YES')
  6. else
  7. begin
  8. a := num div 100;
  9. c := num mod 10;
  10. n := num + (a - c);
  11. if a > c then
  12. writeln(n)
  13. else
  14. begin
  15. n := (num + 10) - (c - a);
  16. writeln(n)
  17. end;
  18. end;
  19. end.
RAW Paste Data