Var a,a1,a2,a3:integer;
begin
write('a = ');
readln(a);
a1:=a div 100;
a2:=a div 10 mod 10;
a3:=a mod 10;
writeln(a,' ',a1*100+a3*10+a2);
writeln(a2*100+a1*10+a3,' ',a2*100+a3*10+a1);
writeln(a3*100+a1*10+a2,' ',a3*100+a2*10+a1);
end.
Пример:
a = 251
251 215
521 512
125 152