Pagini recente » Cod sursa (job #1721081) | Cod sursa (job #698815) | Cod sursa (job #1177142) | Cod sursa (job #1727401) | Cod sursa (job #385561)
Cod sursa(job #385561)
var n,k:integer;
v,a:array[1..18] of byte;
procedure print;
var i:byte;
begin
for i:=1 to k do
writeln(v[i],' ');
end;
procedure back(x:byte);
var i:byte;
begin
for i:=v[x-1]+1 to n do
begin
v[x]:=i;
if x=k then print else back(x+1);
end;
end;
begin
assign(input,'input.in');reset(input);
assign(output,'output.out');rewrite(output);
read(n,k);
back(1);close(input);close(output);
end;