task_url
stringlengths
30
116
task_name
stringlengths
2
86
task_description
stringlengths
0
14.4k
language_url
stringlengths
2
53
language_name
stringlengths
1
52
code
stringlengths
0
61.9k
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#xEec
xEec
i# i# ma h#10 r o# p o$ p
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#XLISP
XLISP
(DEFUN A-PLUS-B () (DISPLAY "Enter two numbers separated by a space.") (NEWLINE) (DISPLAY "> ") (DEFINE A (READ)) (DEFINE B (READ)) (+ A B))
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#Xojo
Xojo
var inp as string var strVals() as string   print("Enter two numbers separated by a space:")   do inp = input     strVals = inp.split(" ")   var a, b as integer   a = strVals(0).toInteger b = strVals(1).toInteger   if a < -1000 or b > 1000 then print("The first number should be greater than or equal to -1000 and the second number should be less " + _ "than or equal to 1000. Please re-enter:") continue end   var result as integer = a + b print(a.toString + " + " + b.toString + " = " + result.toString) exit loop  
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#XPL0
XPL0
include c:\cxpl\codes; int A, B; [A:= IntIn(0); B:= IntIn(0); IntOut(0, A+B); CrLf(0); ]
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#XQuery
XQuery
  (: Using the EXPath File Module, which is built into most XQuery processors by default and thus does not need to get imported. Some processors bind the namespace automatically, others require explicit declaration. :)   xquery version "3.1";   declare namespace file = 'http://expath.org/ns/file';   let $in  := 'input.txt' let $out  := 'output.txt' let $numbers  := tokenize(file:read-text($in)) let $result  := xs:numeric($numbers[1]) + xs:numeric($numbers[2]) return file:write-text($out, xs:string($result))  
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#Yabasic
Yabasic
repeat input "Enter two numbers (betwen -1000 ... +1000): " a, b until(valid(a) and valid(b)) print "\nThe sum of ", a, " and ", b, " is: ", a + b   sub valid(x) return x >= -1000 and x <= 1000 end sub
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#Yorick
Yorick
a = b = 0; read, a, b; write, a + b;
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#ZED
ZED
(A+B) comment: #true (+) (read) (read)   (+) one two comment: #true (003) "+" one two   (read) comment: #true (001) "read"
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#zkl
zkl
do(2){ask("A B: ").split(" ").filter().sum().println()}
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#Zoea
Zoea
program: a_plus_b input: '7 11' output: 18  
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#Zoea_Visual
Zoea Visual
  module ABProblem; var a,b: integer; begin read(a,b); writeln(a+b) end ABProblem.  
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#zonnon
zonnon
  module ABProblem; var a,b: integer; begin read(a,b); writeln(a+b) end ABProblem.  
http://rosettacode.org/wiki/A%2BB
A+B
A+B   ─── a classic problem in programming contests,   it's given so contestants can gain familiarity with the online judging system being used. Task Given two integers,   A and B. Their sum needs to be calculated. Input data Two integers are written in the input stream, separated by space(s): ( − 1000 ≤ A , B ≤ + 1000 ) {\displaystyle (-1000\leq A,B\leq +1000)} Output data The required output is one integer:   the sum of A and B. Example input   output   2 2 4 3 2 5
#ZX_Spectrum_Basic
ZX Spectrum Basic
10 PRINT "Input two numbers separated by"'"space(s) " 20 INPUT LINE a$ 30 GO SUB 90 40 FOR i=1 TO LEN a$ 50 IF a$(i)=" " THEN LET a=VAL a$( TO i): LET b=VAL a$(i TO ): PRINT a;" + ";b;" = ";a+b: GO TO 70 60 NEXT i 70 STOP 80 REM LTrim operation 90 IF a$(1)=" " THEN LET a$=a$(2 TO ): GO TO 90 100 RETURN