September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
17
Task/Arithmetic-Integer/Jq/arithmetic-integer.jq
Normal file
17
Task/Arithmetic-Integer/Jq/arithmetic-integer.jq
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Lines which do not have two integers are skipped:
|
||||
|
||||
def arithmetic:
|
||||
split(" ") | select(length > 0) | map(tonumber)
|
||||
| if length > 1 then
|
||||
.[0] as $a | .[1] as $b
|
||||
| "For a = \($a) and b = \($b):\n" +
|
||||
"a + b = \($a + $b)\n" +
|
||||
"a - b = \($a - $b)\n" +
|
||||
"a * b = \($a * $b)\n" +
|
||||
"a/b|floor = \($a / $b | floor)\n" +
|
||||
"a % b = \($a % $b)\n" +
|
||||
"a | exp = \($a | exp)\n"
|
||||
else empty
|
||||
end ;
|
||||
|
||||
arithmetic
|
||||
Loading…
Add table
Add a link
Reference in a new issue