Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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