Pagini recente » Cod sursa (job #788150) | Cod sursa (job #1962097) | Cod sursa (job #2006626) | Cod sursa (job #2744098) | Cod sursa (job #720229)
Cod sursa(job #720229)
type vector=array[1..100]of integer;
var a:vector; n,m:integer; t:text;
procedure afis;
var i:integer; b:boolean;
begin
b:=true;
for i:=2 to n do
begin
if a[i-1]>=a[i] then b:=false;
end;
if (b=true) then for i:=1 to n do
begin
write(t,a[i]+1,' ');
end;
if (b=true) then writeln(t);
end;
procedure bin(p:integer);
var i,j:integer;
begin
if p>n then afis
else
begin
for j:=0 to m do
begin
a[p]:=j;
bin(p+1)
end;
end;
end;
begin
assign(t,'combinari.in');
reset(t);
readln(t,m,n);
close(t);
assign(t,'combinari.out');
rewrite(t);
m:=m-1;
bin(1);
close(t);
end.