Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Power-set/AWK/power-set.awk
Normal file
10
Task/Power-set/AWK/power-set.awk
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
cat power_set.awk
|
||||
#!/usr/local/bin/gawk -f
|
||||
|
||||
# User defined function
|
||||
function tochar(l,n, r) {
|
||||
while (l) { n--; if (l%2 != 0) r = r sprintf(" %c ",49+n); l = int(l/2) }; return r
|
||||
}
|
||||
|
||||
# For each input
|
||||
{ for (i=0;i<=2^NF-1;i++) if (i == 0) printf("empty\n"); else printf("(%s)\n",tochar(i,NF)) }
|
||||
Loading…
Add table
Add a link
Reference in a new issue