1.该OJ由于交换空间受限,暂不不支持万能头文件:bits/stdc++.h!!! 2.该OJ如果是长整型的话,C的输入输出请使用%lld!!!

Problem 1001. -- A+B Problem

1001: A+B Problem

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 20  Solved: 4
[Submit][Status][Web Board]

Description

calculate A+B

注意测试数据有多组,请以文件结尾作为结束标记(EOF)

Input

A B

Output

A+B的值

Sample Input

1 2
1 1

Sample Output

3
2

HINT

标准代码(仅供参考):


C:


#include <stdio.h>

int main(){

    int a,b;

    while(scanf("%d %d",&a, &b) != EOF)

        printf("%d\n",a+b);

return 0;

}

C++;


#include <iostream>

using namespace std;

int main(){

    int a,b;

    while(cin >> a >> b)

        cout << a+b << endl;

return 0;

}

Java:


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);

}

}

}

Source

[Submit][Status][Web Board]