CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
14
Task/Arithmetic-Integer/Elena/arithmetic-integer.elena
Normal file
14
Task/Arithmetic-Integer/Elena/arithmetic-integer.elena
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#define std'basic'*.
|
||||
#define math'* = std'math'*.
|
||||
|
||||
#symbol Program =
|
||||
[
|
||||
#var a := 'program'input >> Integer.
|
||||
#var b := 'program'input >> Integer.
|
||||
|
||||
'program'output << a << " + " << b << " = " << a + b << "%n".
|
||||
'program'output << a << " - " << b << " = " << a - b << "%n".
|
||||
'program'output << a << " * " << b << " = " << a * b << "%n".
|
||||
'program'output << a << " / " << b << " = " << a / b << "%n". // truncates towards 0
|
||||
'program'output << a << " %% " << b << " = " << a~math'eops math'modulus:b << "%n". // matches sign of first operand
|
||||
].
|
||||
Loading…
Add table
Add a link
Reference in a new issue