A+B: Difference between revisions
→{{header|Fennel}}
m (→{{header|Sidef}}: updated code) |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 1,412:
=={{header|AWK}}==
<syntaxhighlight lang="awk">{print $1 + $2}</syntaxhighlight>
=={{header|BabyCobol}}==
<syntaxhighlight lang="cobol">
* NB: COBOL's ACCEPT does not work with multiple identifiers
IDENTIFICATION DIVISION.
PROGRAM-ID. PLUS.
DATA DIVISION.
01 A PICTURE IS S9999.
01 B LIKE A.
PROCEDURE DIVISION.
DISPLAY "Enter two numbers: " WITH NO ADVANCING.
ACCEPT A B.
ADD A TO B.
DISPLAY "A+B =" B.
</syntaxhighlight>
=={{header|BASIC}}==
Line 1,818 ⟶ 1,833:
<syntaxhighlight lang="brat">numbers = g.split[0,1].map(:to_i)
p numbers[0] + numbers[1] #Prints the sum of the input</syntaxhighlight>
=={{header|Bruijn}}==
<syntaxhighlight lang="bruijn">
:import std/Combinator .
:import std/String .
:import std/Number .
:import std/Char C
main (split-by (C.eq? ' ')) → &(add ⋔ string→number)
</syntaxhighlight>
=={{header|Burlesque}}==
Line 2,314 ⟶ 2,339:
=={{header|EasyLang}}==
<syntaxhighlight
repeat
while i < len a$ and substr a$ i 1 <> " "▼
i += 1
.
a = number substr a$ 1 i
b = number substr a$ i
print a + b
</syntaxhighlight>
Line 2,785 ⟶ 2,811:
PAUSE</syntaxhighlight>
=={{header|Fennel}}==
{{trans|Lua}}
<syntaxhighlight lang="fennel">
(let [(a b) (io.read :*number :*number)]
(print (+ a b)))
</syntaxhighlight>
=={{header|Fhidwfe}}==
|