1001 A+B Problem

Posted heibaimao123

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了1001 A+B Problem相关的知识,希望对你有一定的参考价值。

Calculate a+b

计算a+b

Input

输入

The input will consist of a series of integers a and b, separated by a space, one pair of integers pet line

输入由一对整数a和b组成,由一个空格分开,每行有一对整数

Output

输出

For each pair of input integers a and b you should output the sum of  a and b in one line, and with one line of output for each line in input

对于每一对整数a和b,你应该在一行中输出a和b的和,在输入的每一行中输出一行

Sample Input

输入示例

1 5

Sample Output

输出示例

6

Hint

提示

Use + operator

用+运算符

Sample Program Here

程序示例

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

 

以上是关于1001 A+B Problem的主要内容,如果未能解决你的问题,请参考以下文章

1001 A + B Problem

luogu1001 A+B Problem

洛谷 P1001 A+B Problem

Luogu P1001 A+B Problem

题目1001:A+B for Matrices

PAT 甲级 1001 A+B Format