A+B Problem

Time Limit:1000MS  Memory Limit:65535KB
Description:
Calculate A + B,and give me the answer!
Input:
Input two integers A and B.(Watch the Sample Input)
Output:
For each case, output A + B in one line..(Watch the Sample Output)
Sample test:
Input
1 2
Output
3
Note:
Press the Submit to submit your code!
Q: Where is the input and the output?
A: Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output').
For example, you can use 'scanf' in C or 'cin' in C++ to read from stdin, and use 'printf' in C or 'cout' in C++ to write to stdout. User programs are not allowed to open and read from/write to files, you will get a "Restricted Function" if you try to do so.
Here is a sample solution for problem 1000 using C:
#include <stdio.h>
int main(void)
{
    int a,b;
    while(scanf("%d%d", &a,&b) != EOF)
        printf("%d\n",a+b);
    return 0;
}
Here is a sample solution for problem 1000 using C++:
#include <iostream>
using namespace std;
int main(void)
{
    int a,b;
    while(cin >> a>>b)
        cout << a+b<<endl;
    return 0;
}
Here is a sample solution for problem 1000 using Java:
import java.util.Scanner;
public class Main {
 public static void main(String[] args) {
  Scanner in = new Scanner(System.in);
  while (in.hasNextInt()) {
   int a = in.nextInt();
   int b = in.nextInt();
   System.out.println(a + b);
  }
 }
}
Source:
Author:
ACSolo