# 1000：A+B problem

Calculate a+b.

###### 输入解释

Two integers a and b, there is more than one input.

Output a + b.

###### 输入样例 1
1 2
###### 输出样例 1
3

###### 输入样例 2
89 0
0 0
0 1
###### 输出样例 2
89
0
1

###### 提示
-2147483646 < a+b < 2147483647

C++/Clang++:

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


C/Clang:

#include <stdio.h>
int main(){
int a,b;
while(scanf("%d %d",&a, &b) != EOF)
printf("%d\n",a+b);
return 0;
}


PASCAL:

program p1000(Input,Output);
var
a, b: Longint;
begin
while not eof(Input) do
begin
Writeln(a + b);
end;
end.

Java1.7:

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

Python2.7/Python3.5:

import sys
for line in sys.stdin:
a = line.split()
print(int(a[0]) + int(a[1]))


Perl:

@str =<STDIN>;
foreach $line (@str) { @arr = split(/\s/,$line);
print (@arr[0] + @arr[1]."\n");
}


JavaScript:

var readline = require('readline');

input:process.stdin,
output:process.stdout
});

rl.on("line",function(stdin){
a = stdin.split(" ");
if (! isNaN(parseInt(a[0]))) {
console.log(parseInt(a[0]) + parseInt(a[1]));
}
});


PHP:

<?php
while(fscanf(STDIN, "%d %d", $a,$b) == 2)
echo ($a +$b)."\n";


C#:

using System;
class Acm
{
static void Main()
{
string input;
{
string[] ss;
ss = input.Split();
Console.WriteLine(long.Parse(ss[0]) + long.Parse(ss[1]));
}
}
}


GoLang:

package main

import (
"fmt"
"io"
)

var a, b int

func main() {
for {
_, err := fmt.Scanf("%d %d", &a, &b)
if err == io.EOF {
break
}
fmt.Printf("%d\n", a + b)
}
}

 时间上限 内存上限 1000 MS 128 MB