Jump to content

Combinations: Difference between revisions

Line 1,280:
@n = (0 .. 4);
print join("\n", map { join(" ", @{$_}) } combine(3, @n)), "\n";</lang>
 
=={{header|PARI/GP}}==
<lang parigp>c(n,k,r,d)={
if(d==k,
for(i=2,k+1,
print1(r[i]" "));
print
,
for(i=r[d+1]+1,n,
r[d+2]=i;
c(n,k,r,d+1)));
}
 
c(5,3,vector(5,i,i-1),0)
</lang>
 
=={{header|Pascal}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.