update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
14
Task/Arithmetic-Integer/Erlang/arithmetic-integer.erl
Normal file
14
Task/Arithmetic-Integer/Erlang/arithmetic-integer.erl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
% Implemented by Arjun Sunel
|
||||
-module(arith).
|
||||
-export([start/0]).
|
||||
|
||||
start() ->
|
||||
case io:fread("","~d~d") of
|
||||
{ok, [A,B]} ->
|
||||
io:format("Sum = ~w~n",[A+B]),
|
||||
io:format("Difference = ~w~n",[A-B]),
|
||||
io:format("Product = ~w~n",[A*B]),
|
||||
io:format("Quotient = ~w~n",[A div B]), % truncates towards zero
|
||||
io:format("Remainder= ~w~n",[A rem B]), % same sign as the first operand
|
||||
halt()
|
||||
end.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
my Int $a = floor $*IN.get;
|
||||
my Int $b = floor $*IN.get;
|
||||
my Int $a = get.floor;
|
||||
my Int $b = get.floor;
|
||||
|
||||
say 'sum: ', $a + $b;
|
||||
say 'difference: ', $a - $b;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue