Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Factorial/Draco/factorial.draco
Normal file
19
Task/Factorial/Draco/factorial.draco
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* Note that ulong is 32 bits, so fac(12) is the largest
|
||||
* supported value. This is why the input parameter
|
||||
* is a byte. The parameters are all unsigned. */
|
||||
proc nonrec fac(byte n) ulong:
|
||||
byte i;
|
||||
ulong rslt;
|
||||
rslt := 1;
|
||||
for i from 2 upto n do
|
||||
rslt := rslt * i
|
||||
od;
|
||||
rslt
|
||||
corp
|
||||
|
||||
proc nonrec main() void:
|
||||
byte i;
|
||||
for i from 0 upto 12 do
|
||||
writeln(i:2, "! = ", fac(i):9)
|
||||
od
|
||||
corp
|
||||
Loading…
Add table
Add a link
Reference in a new issue