Pagini recente » Cod sursa (job #3264639) | Cod sursa (job #2176857) | Cod sursa (job #3283175) | Cod sursa (job #153642) | Cod sursa (job #153884)
Cod sursa(job #153884)
var a:array[1..50] of integer;
n,k:longint;
procedure back(s:longint);
var i:longint;
begin
if (s=k) then begin
for i:=1 to k do
write(a[i],' ');
writeln;
end
else begin
for i:=a[s+1] to n do
begin
a[s+1]:=i;
back(s+1);
end;
end;
end;
begin
assign(f,'combinari.in');reset(f);
assign(g,'combinari.out');rewrite(g);
readln(n,k);
back(0);
close(f);
close(g);
end.