Pagini recente » Cod sursa (job #512485) | Cod sursa (job #239760) | Cod sursa (job #2981434) | Cod sursa (job #609146) | Cod sursa (job #1198922)
var n:byte;
procedure cod(s:string);
var i,j:byte;
c:string;
ok:boolean;
begin
if length(s)=n then begin for i:=1 to n do write(s[i],' ');writeln;end
else
begin
for i:=1 to n do
begin
str(i,c);
ok:=false;
for j:=1 to length(s) do if s[j]=c[1] then ok:=true;
if not ok then cod(s+c[1]);
end;
end;
end;
begin
assign(input,'permutari.in');
reset(input);
read(n);
close(input);
assign(output,'permutari.out');
rewrite(output);
cod('');
close(output);
end.