September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
19
Task/Multifactorial/AWK/multifactorial.awk
Normal file
19
Task/Multifactorial/AWK/multifactorial.awk
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# syntax: GAWK -f MULTIFACTORIAL.AWK
|
||||
# converted from Go
|
||||
BEGIN {
|
||||
for (k=1; k<=5; k++) {
|
||||
printf("degree %d:",k)
|
||||
for (n=1; n<=10; n++) {
|
||||
printf(" %d",multi_factorial(n,k))
|
||||
}
|
||||
printf("\n")
|
||||
}
|
||||
exit(0)
|
||||
}
|
||||
function multi_factorial(n,k, r) {
|
||||
r = 1
|
||||
for (; n>1; n-=k) {
|
||||
r *= n
|
||||
}
|
||||
return(r)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue