Advertisement
Shiyan12

Untitled

May 17th, 2021
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.23 KB | None | 0 0
  1. var x, a, b, c, res: integer;
  2. begin
  3.   readln(x);
  4.   if x mod 2 = 0 then
  5.     res := 2 * x
  6.   else begin
  7.     c := x mod 10;
  8.     b := (x div 10) mod 10;
  9.     a := x div 100;
  10.     res := c * 100 + b * 10 + a;
  11.   end;
  12.   writeln(res);
  13. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement