A+B Problem

From Esolang
Jump to navigation Jump to search

A+B problem is a challenge that reads two decimal integers, add, and output.

Usually, the input value is constrained in some way.

The "input" and "output" can be done using I/O, memory storage, etc.

Implementations

;x

i:,;:)=:;x`
i:,;:)=:;y`
0=:;z`
-48:;x)=:;x`
-48:;y)=:;y`
+y:;x)=:;z`
+48:;z)=:;z`

Highest calculation : 0+9

$+-?

$------------------------------------------------A?p-$+$aP$

1

111*111*111*11*1*,111*111*11*1*,*1,

Adj

ADJ 1 a X
ADJ 1 b X
ADJ a b X
ADJ 0 a X

Aheui

방방다망희

Bash

read aaa
read bbb
echo $((aaa+bbb))

Befunge

&&+.@

BracketOnly

(()()()()()()()()()()()()()()()())((()())((()()()()()()()()()()()())()(()()()()()()()()()()()())()))

Brain-Flak

({}{})

Brainf*ck

>[,,,++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<>[.]<

Only supports adding one-digit numbers, numbers have to be separated by exactly one space:

Input: 1 2
Output: 3

brainfuck

More implementations at A+B Problem/brainfuck.

This implementation accepts any number of decimal integers separated by spaces. It will add them all up and output the result in decimal.

>,[-------------------------------->+<[>>+++++++++
  [>>>
    [<+>->[>]>[>]+[<]<[<]>]<<
    [->+<<]<-
  ]>>>[>]+[>]<-<[<]<<<<----------------
  [>>>>>[>]+[<]<<<<-]
>>]>[->>>>[-<<<<<+>>>>>>]<<<<+>>]<<-<,]>>>>>[-<<<<<+>>>>>>]<<----------<<<<
[
  [<]>->[>]>>+
    [>[+<-]<[->---------<<]>+>[<-]<[->---------->>+<]>]
  >[<<<]<
]
>>>>[>>>]<<<[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.<<<]

In the first stage, characters are read from STDIN while an accumulated value is stored in unary on the tape. For each digit character, the accumulated value is multiplied by 10 and the character’s value added to it. For each space character, the accumulated value is appended to the previous accumulated value and a new one started. When input runs out, the result is available in unary. The second stage converts the unary number back into decimal, then converts digits to ASCII and outputs them.

Brainfuck+

;>;<a:

Brainfuck+2

Unlike brainfuck, you don't have to handle number input/output yourself, which results in a more simple program:

';>;[<+>-]<:

It turns off overflow mode to accept all unbounded unsigned integers.

Brainfuck extended

(@(+%)

BrainZ

The following programs are in hex dump

01 55 55 55 55 55 55 55 55 55 55 55 55 20 20 2A AA AA AA AA AA AA AA AA AA AA AA A1 46 41 1F FF FF FF FF FF F0 20

Both the input and the result have to be one-digit numbers, and the two numbers in the input are separated by exactly one space (or any other character, but there must be exactly one).

Actually I have a better one that uses algorithms mentioned in brainfuck algorithms.

0A 09 0A 0C 21 41 21 41 01 0C 2A AA AA 84 85 07 F0 8A AA 94 11 51 10 A4 FF E2 20 92 14 46 48 23 20 82 08 82 48 50 48 50 61 0A 09 0A 08 08 61 55 55 54 24 28 3F 84 55 54 A0 8A 88 85 27 FF 11 04 90 A2 32 41 19 04 10 44 11 0A 22 32 48 23 FF 88 85 32 84 C9 04 86 14 64 13 24 11 11 11 10 49 0A 09 27 FF 10 A5 09 92 09 0C 28 C8 26 48 22 22 22 09 0A 09 21 3F 85 1F F2 08 81 11 99 0A 08 22 11 0A 51 07 F0 A7 FC 41 20 42 82 08 8F E1 47 FC 82 20 40

It only works on 8 bit cells, and the numbers in the input and the result should not exceed 255. The two numbers in the input are separated by line feeds.

bruh():bruh()

bruh():out(add(in(),in()))

C

#include<stdio.h>
void main()
{
    int x,y;
    scanf("%d%d",&x,&y);
    printf("%d",x+y);
}

C++

#include<iostream>
using namespace std;
int main()
{
    int x,y;
    cin >> x >> y;
    cout << (x+y) << endl;
    return 0;
}

C#

using System;
class Program {
	static void Main(string[] args) {
		Console.WriteLine(Convert.ToInt64(Console.ReadLine())+Convert.ToInt64(Console.ReadLine()));
	}
}

Chicken

Only supports one-digit A+B, for example, input is 1 2 and output will be 3.

chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken
chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken
chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken
chicken chicken

Chinese

定义 甲,乙,丙 为 整数
读入 甲
读入 乙
丙=甲+乙
打印 丙

Countable

// populating lookup table
256+48 256+48
a256+1 256+1 a256+0 256+1
a256+1 256+1 a256+1 256+1
a256+1 256+1 a256+2 256+1
a256+1 256+1 a256+3 256+1
a256+1 256+1 a256+4 256+1
a256+1 256+1 a256+5 256+1
a256+1 256+1 a256+6 256+1
a256+1 256+1 a256+7 256+1
a256+1 256+1 a256+8 256+1
a256+1 256+1 a256+9 256+1

// 257 = number A
// 258 = number B
259+271 // previous value
260+274 // cur value
261+275 // input
262+276 // lookup
263+256 // current number

1*2<
  263+1 // advance to next number
  2*∞<
    a261@    // get input
    *aa261<  // find the corresponding value in the lookup table 
      a262+2
    >
    *aaa262< // is it a number?
      a262+1 // get the literal value
      *10<   // multiply the last value by 10
        a260+aa259
      >
      a260+aaa262 // append the new digit
      259+3
      260+3
      261+3
      262+3
      2&
    >
    a263+aa259 // if not, output the result
    259+3
    260+3
    261+3
    262+3
    1&
  >
>

264+a262 264+1 // previous current value
a264+a257 a264+a258 // A + B
265+a262 265+2 // previous reversed value

266+a262 266+aa264 266+aa264 266+1 // current value
267+a262 267+aa264 267+aa264 267+2 // reversed value
268+a262 268+aa264 268+aa264 268+4 // equal flag
269+a262 269+aa264 269+aa264 269+3 // previous mod
270+a262 270+aa264 270+aa264 270+4 // pointer

// reverse the result for printing
0*1<
  *∞<
    1*1<
      *aa264<
        *aa264< // move the equal flag to the end
          268+2
        >
        1& // check if current value isn't zero here
      >
      0& // otherwise the first step is done
    >
    a268+1 // set it
    a269+9 // for modulo calculation
    10*1<
      *∞< // calculate division + mod
        *10<
          *aa270<
            10&
          >
          270+1
          9*1<
            0*1< // preventing early exit
              aa269& // check if mod will surpass 10
            >
            a270+aa269 a270+1 // increment otherwise
          >
          270+1
          269+2
        >
        a266+1
      >
    >
    270+1
    9*1< // one last pass
      0*1< // preventing early exit
        aa269& // check if mod will surpass 10
      >
      a270+aa269 a270+1 // increment otherwise
    >
    *10< // push to the reversed string
      a267+aa265
    >
    a267+aa270
    // shift right
    268+5
    269+5
    270+4
    a266*1< // move last reverse pointer to current value pointer
      *∞<
        a265&
        265+1
      >
    >
    266+aa264 266+aa264 266+5
    267+aa264 267+aa264 267+5
    a265*1< // move last value pointer to last reverse pointer
      *∞<
        a264&
        264+1
      >
    >
    265+1
  >
>

// output the result (same logic as before)
a264+aa265
0*1<
  *∞<
    1*1<
      *aa264<
        *aa264< // move the equal flag to the end
          268+2
        >
        1& // check if current value isn't zero here
      >
      0& // otherwise the first step is done
    >
    a268+1 // set it
    a269+9 // for modulo calculation
    10*1<
      *∞< // calculate division + mod
        *10<
          *aa270<
            10&
          >
          270+1
          9*1<
            0*1< // preventing early exit
              aa269& // check if mod will surpass 10
            >
            a270+aa269 a270+1 // increment otherwise
          >
          270+1
          269+2
        >
        a266+1
      >
    >
    270+1
    9*1< // one last pass
      0*1< // preventing early exit
        aa269& // check if mod will surpass 10
      >
      a270+aa269 a270+1 // increment otherwise
    >
    a270+48
    %aa270 // output digit
    // shift right
    268+5
    269+5
    270+4
    a266*1< // move last reverse pointer to current value pointer
      *∞<
        a265&
        265+1
      >
    >
    266+aa264 266+aa264 266+5
    267+aa264 267+aa264 267+5
    a265*1< // move last value pointer to last reverse pointer
      *∞<
        a264&
        264+1
      >
    >
    265+1
  >
>

Duckwise Northward

!#?k^%c)(_

Deadfish++

yrya~[0]+[1];rmao

Desmos

A+B | desmos

Egnufeb

>i{a}i{b}+p

enGLish

Declare a variable named a, initially 0
Input x
Declare a variable named b, initially 0
Input y
Declare a variable named sum, initially 0
Store the sum of a and b into sum
Output sum

Exechars

Input two numbers separated by commas, such as 16,35
This one is special in that it outputs A+B=C instead of the usual

i0i1r2b+ar3d+b+10-10(0+3?3<1/0)(1+4?4!0/1)(2+2-0?0!10/2)(3+2-1?1!10/3)/0/1/2/3n4oan3obn2t

A much shorter way, not possible with Execode:

i0i1r2b+ar3d+br0v+2r1v+2n0oan1obn2t

Modify it trivially to get A-B:

 i0i1r2d+ar3d+b+10-10(0+3?3<1/0)(1+4?4!0/1)(2+2-0?0!10/2)(3-2-1?1!10/3)/0/1/2/3n4oan3obn2t

The shorter way:

i0i1r2d+ar3d+br0v+2r1v-2n0oan1obn2t

Execode

Input two numbers separated by commas, such as 16,35
Like the above, outputs A+B=C

def var 0
inp 0
def var 1
inp 1
def fnc 0
inc 3
con 1 gt 3
cll 5
end
def var 5
def fnc 1
inc 4
con 0 ne 4
cll 6
end
def var 6
inc 6
def fnc 2
inc 2
dec 0
con 0
cll 7
end
def var 7
inc 7 rpt 2
def fnc 3
inc 2
dec 1
con 1
cll 8
end
def var 8
inc 8 rpt 3
def var 2
def var 3
def var 4
cll 5
cll 6
cll 7
cll 8
def var 9
inc 9 rpt 43
def var 10
inc 10 rpt 61
out 4
outchr 9
out 3
outchr 10
out 2
ter

Modify it trivially to get A-B:

def var 0
inp 0
def var 1
inp 1
def fnc 0
inc 3
con 1 gt 3
cll 5
end
def var 5
def fnc 1
inc 4
con 0 ne 4
cll 6
end
def var 6
inc 6
def fnc 2
inc 2
dec 0
con 0
cll 7
end
def var 7
inc 7 rpt 2
def fnc 3
dec 2
dec 1
con 1
cll 8
end
def var 8
inc 8 rpt 3
def var 2
def var 3
def var 4
cll 5
cll 6
cll 7
cll 8
def var 9
inc 9 rpt 45
def var 10
inc 10 rpt 61
out 4
outchr 9
out 3
outchr 10
out 2
ter

Expansion

[0 0]=0
[0 1]=1
[0 2]=2
[0 3]=3
[0 4]=4
[0 5]=5
[0 6]=6
[0 7]=7
[0 8]=8
[0 9]=9
[1 0]=1
[1 1]=2
[1 2]=3
[1 3]=4
[1 4]=5
[1 5]=6
[1 6]=7
[1 7]=8
[1 8]=9
[1 9]=10
[2 0]=2
[2 1]=3
[2 2]=4
[2 3]=5
[2 4]=6
[2 5]=7
[2 6]=8
[2 7]=9
[2 8]=10
[2 9]=11
[3 0]=3
[3 1]=4
[3 2]=5
[3 3]=6
[3 4]=7
[3 5]=8
[3 6]=9
[3 7]=10
[3 8]=11
[3 9]=12
[4 0]=4
[4 1]=5
[4 2]=6
[4 3]=7
[4 4]=8
[4 5]=9
[4 6]=10
[4 7]=11
[4 8]=12
[4 9]=13
[5 0]=5
[5 1]=6
[5 2]=7
[5 3]=8
[5 4]=9
[5 5]=10
[5 6]=11
[5 7]=12
[5 8]=13
[5 9]=14
[6 0]=6
[6 1]=7
[6 2]=8
[6 3]=9
[6 4]=10
[6 5]=11
[6 6]=12
[6 7]=13
[6 8]=14
[6 9]=15
[7 0]=7
[7 1]=8
[7 2]=9
[7 3]=10
[7 4]=11
[7 5]=12
[7 6]=13
[7 7]=14
[7 8]=15
[7 9]=16
[8 0]=8
[8 1]=9
[8 2]=10
[8 3]=11
[8 4]=12
[8 5]=13
[8 6]=14
[8 7]=15
[8 8]=16
[8 9]=17
[9 0]=9
[9 1]=10
[9 2]=11
[9 3]=12
[9 4]=13
[9 5]=14
[9 6]=15
[9 7]=16
[9 8]=17
[9 9]=18
*[''A'' ''B'']

Replace A and B to the two numbers you want to add, they must be one-digit.

Factor

1550312130344523405322670672726144276060320428835586125982062278216873380299547785445888965317356993578998458894062824590818181343465544643203278969789760306483260898195025071606514680066312822882289150961729164240257496460164711229028838279617380759313885377180750696493806042467569915139382024410955786156745725726158898119

Both the input and the result have to be one-digit numbers, and the two numbers in the input are separated by exactly one space (or any other character, but there must be exactly one).

Actually I have a better one that uses algorithms mentioned in brainfuck algorithms.

223410076043971245540455586062108671976382093084650814048455942695029728847248299149137635554999424822108920506098868033476214459320120499009107004136078049794893673781761295204469664667935339948220791969940797178711884552892973753625015470549096824911093718441469356768533249165014176626741614824403577081277068387982322629535712447454364104489588780254372499850172986326729405696524997412110326083025627210689998917530563991619062944140202877791117569707740865348999991542007107447224733604600000527878988213435845838869570404281302989627799961769506811874060021300896611729156306973830638599329303622560576731383760330633151857809874340774202118735387543078461597660714598235881914663270305145053382281893795661261671652072174089103101132267118681988227624613185931131543618491818705958774014872388695403663087930058282062807944776002596264627880492322717384703232216135346484920131957918341425918130884150142467794506237984533771367614705105664172251120356711890741861382387138254921794223791411080320254372901167902742308408394759875459949509185990551844055573095741697932045088640395955024237597472362455681672376050549253700368981271604291990235515264750252871044914433037348488635473615344302888662605466698658948109839364491561884085899786063927241502662408998462517291640998101657371778834680047837565519172095276588293322125139653792272461457837353049108094141833488627267796682360797868482152871439304768041176143520773935566597

It only works on 8 bit cells, and the numbers in the input and the result should not exceed 255. The two numbers in the input are separated by line feeds.

Func++

intoutput(add(intinput(),intinput())

Funciton

This program requires several of the library functions — to make it a fully self-contained program, all of those functions could be pasted in.

 ╔════╗ ┌───╖ ╔═══╗
 ║ 32 ╟─┤ ǁ ╟─╢   ║
 ╚════╝ ╘═╤═╝ ╚═══╝
        ┌─┴─╖ ┌───╖ ┌───╖
        │ ɱ ╟─┤ ∑ ╟─┤ 》 ╟─
        ╘═╤═╝ ╘═══╝ ╘═══╝
  ┌───╖ ╔═╧═╕ ╔═══╗
┌─┤ 《 ╟─╢   ├─╢ 0 ║
│ ╘═══╝ ╚═╤═╛ ╚═══╝
└─────────┘

The program first splits (ǁ) the input string at the spaces (32), uses map (ɱ) to convert each substring to an integer (), sums those integers () and converts the result back to a string ().

G#

integer assign a as input
integer assign b as input
make main[print[#a+#b]]

Gofe

,&s,As.

Headache (lang that compiles to brainfuck)

void main(){
    int a;
    int b;
    #a;
    #b;
    @((a+b) as int);
}

It supports 32-bit integers, the compiled brainfuck program is 135420 bytes long so I'm not gonna show it here.

How dare you fuck the brain

;=;+NH

H̱hHhH̱HhH̱H̱hHhH̱HH̱HhhH̱HhH̱H̱hHhH̱HH̱h

HZCode

听听加说停

Iterate

(*)1<
  *?< (1*)<> >
  *?< (1*)<> >
  (2*)=1<
    *~n< &2 >
    @
    !^
  >
  (3*)48<
    *~n< &3 >
    ~@
  >
>

Java

import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        System.out.println(a+b);
     }
}

JavaScript

function add(a,b){
    console.log(a+b);
}

I use a function, because it seems that JavaScript has no functions for input.

This is an alternative for browser JS only:

f=prompt;alert(+f()+(+f()))

This runs in the console, and the input is separated by spaces.

process.stdin.setEncoding('utf8')
process.stdin.on(
 'data',
 (data)=>{
  let l=data.slice(0,-1).split(' ')
  console.log((+l[0])+(+l[1]))
  process.exit()
 }
)

Using readline:

const readline = require('readline');                      
const rl = readline.createInterface({
 input: process.stdin,
 output: process.stdout
});
 rl.question("", (a) => {
  rl.question("", (b) => {
   console.log(Number(a)+Number(b));
   rl.close();
  });
});

JSFuck

This is a JScrew.it conversion from f=prompt;alert(+f()+(+f())), works only in new browsers (Chrome, Firefox, Edge, Safari and Opera), 3559 bytes, if you have a shorter one please replace this.

[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(!![]+[])[!![]+!![]+!![]]+([![]][+(+[]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+[]]]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]+[+[]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]])()((![]+[])[+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]()[+!![]+[+!![]]]+(+(!![]+!![]+[+!![]]+(+[])+(+[])+(+!![])+(!![]+!![])+(!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!![]+!![]+!![]+!![]+!![])))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([]+[])[([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]][([][[]]+[])[+!![]]+(![]+[])[+!![]]+([]+(+[])[([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]])[+!![]+[+!![]]]+(!![]+[])[!![]+!![]+!![]]]](!![]+!![]+!![]+[+[]])+(!![]+[])[+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]](([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]())[!![]+!![]+!![]+[+[]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]])

This is a JScrew.it conversion from (f,t)=>f+t, works in the browser and in Node.js, 1644 bytes, if you have a shorter one please replace this.

[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+[+!![]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]])()(([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+[][(![]+[])[+[]]+(![]+[])[!![]+!![]]+(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]]((![]+[])[+[]]+(!![]+[])[+[]])+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[!![]+!![]]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]()[+!![]+[+!![]]]+([]+[])[([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]]+([![]]+[][[]])[+!![]+[+[]]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]()[!![]+!![]]+(![]+[])[+[]]+(+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[]))+[])[!![]+!![]]+(!![]+[])[+[]])

Kawa

Raw text:

input;asone;;;
input;asone;;;
nop;withtwo,asone;;;
output;;;;

MEMORYLEEK

point a;
point b;
vnput a;
vnput b;
!(a + b);
a ~> 1; #a;
a ~> 1; #a;
a ~> 1; #a;
:a; :b;

Mode Spam

,,,z,>,>,z<}<+{<,,,,z>o

MoreMathRPN

inputR
inputR
+
outputV

If the input must be a string then:

repeat 2
 jmp 2
 del 0
 inputS
 hold len
 1
 -> 1
 step
 -
 -9
 *
 jmp ]0
 del 0
 0
 repeat $len
  >> 1
  47
  -
  step
  4
  *
  jmp ]0
   del 0
   del 1
   jmp 19
  del 0
  58
  >> 2
  -
  step
  4
  *
  jmp ]0
   del 0
   del 1
   jmp 8
  del 0
  10
  *
  -> 1
  48
  -
  +
 next
next
+
outputV

ObjLang

e9oFcHJpbnRbAgAAAHvaCGludGlucHV0WwAAAAAwe3IBAAAAWwAAAAAwMA==

Unmarshalled form:

{'print': [{'intinput': []}, {'intinput': []}]}

PostScriptum

AFAIK, IO
pls a
pls b
read a
read b
ASAP (e.g.:a,b)

Powershell

$a=read-host
$b=read-host
$c=[Convert]::ToInt32($a)+[Convert]::ToInt32($b)
write-host $c

Python

print(sum([int(i) for i in input().split()]))

Or:

print(int(input())+int(input()))

You also can write this:

a = int(input())
b = int(input())
c = a + b;
print(c)

Smalltalk

(GNU Smalltalk)

(stdin nextLine asInteger+(stdin nextLine asInteger))printNl

Sokolang

 ###
 #*#
##I####
#@*.O*#
#..####
 #.#
 ###
---

@:13
i:13
o:1,11

---

rudwup2[dlr]dwp2u2rplwplwprlwp2r2lud

Spam

Hear a, please read line 4.
I want to tell you a secret, please read line 1.
I just want to say, you are fooled.
Hear b, please read line 6.
Say a, please read line 3.
Add a by b, please read line 5.

Spoiler:

∅|^ī|^ī+"∅

Stack-based

VAR x
I x
VAR y
I y
VAR z
A x y z
O z

Standard modern vernacular

定义整型变量 A 、 B 和 C 。
读入 A 和 B,然后将 A+B 存储到 C 中。
输出 C 的值。

Stringle

The number of characters in e represents the upper bound for a and b.

e "!!!!!!!!!!!!!!!!"
e e e
e e e
e e e
e e e
e e e
e e e
e e e
e e e
e e e
e e e
e e e
a $
b $
f e
#e a
#f b
g e f
$ #g

Subleq

a b are the inputs.

0 0 5 a b 4 0 8 0 3 11 0 -1 -1

first make address 0 -b, then substract a by -b to make a+b.

TESTLANG

in push in in push in op add

This esolang is not a push-down automata

,,+.

Thue

Accepts two non-negative integers as input and outputs their sum.

This program is slow for large inputs because it converts the input into unary numbers to calculate.

i::=:::

[0]::=~0
[1]::=~1
[2]::=~2
[3]::=~3
[4]::=~4
[5]::=~5
[6]::=~6
[7]::=~7
[8]::=~8
[9]::=~9

[0>]0::=[<1]
[0>]1::=[<1]*
[0>]2::=[<1]**
[0>]3::=[<1]***
[0>]4::=[<1]****
[0>]5::=[<1]*****
[0>]6::=[<1]******
[0>]7::=[<1]*******
[0>]8::=[<1]********
[0>]9::=[<1]*********
[0>]*::=*[0>]
[0>]||::=|[0>]i|
[0>]|)::=[<2]|)

*[<1]::=[<1]**********
|[<1]::=|[0>]

*[<2]::=[<2]*
*|[<2]::=[<2]*
||[<2]::=|[<2]
(|[<2]::=(|[3>]

[3>]**********::=*[3>]
[3>]|::=[<4]|0
[3>]*|::=[<4]|1
[3>]**|::=[<4]|2
[3>]***|::=[<4]|3
[3>]****|::=[<4]|4
[3>]*****|::=[<4]|5
[3>]******|::=[<4]|6
[3>]*******|::=[<4]|7
[3>]********|::=[<4]|8
[3>]*********|::=[<4]|9

*[<4]::=[<4]*
|[<4]*::=|[3>]*
|[<4]|::=o

o0::=o[0]
o1::=o[1]
o2::=o[2]
o3::=o[3]
o4::=o[4]
o5::=o[5]
o6::=o[6]
o7::=o[7]
o8::=o[8]
o9::=o[9]

::=

(|[0>]i||)

Trampolines

|o#
|,#
|,#
|+#
|;#
|##

Uiua

&p+∩⋕⍥&sc2

WhatLang

¿pr@@pr@@+.

External resources