Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
17
Task/Arithmetic-Integer/Ursa/arithmetic-integer.ursa
Normal file
17
Task/Arithmetic-Integer/Ursa/arithmetic-integer.ursa
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#
|
||||
# integer arithmetic
|
||||
#
|
||||
|
||||
decl int x y
|
||||
out "number 1: " console
|
||||
set x (in int console)
|
||||
out "number 2: " console
|
||||
set y (in int console)
|
||||
|
||||
out "\nsum:\t" (int (+ x y)) endl console
|
||||
out "diff:\t" (int (- x y)) endl console
|
||||
out "prod:\t" (int (* x y)) endl console
|
||||
# quotient doesn't round at all, but the int function rounds up
|
||||
out "quot:\t" (int (/ x y)) endl console
|
||||
# mod takes the sign of x
|
||||
out "mod:\t" (int (mod x y)) endl console
|
||||
Loading…
Add table
Add a link
Reference in a new issue