Ngôn ngữ Pascal:
program p1000(Input,Output);
var a,b:Integer;
begin
Readln(a,b);
Writeln(a+b);
end;
Ngôn ngữ C:
#include <stdio.h>
int main() {
int a, b;
scanf("%d%d", &a, &b);
printf("%d", a+b);
}
Ngôn ngữ C++:
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a+b;
}
Ngôn ngữ Java:
import java.util.Scanner;
public 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);
}
Ngôn ngữ Python:
while True:
try:
a = int(input())
b = int(input())
print(a+b)
except:
break