您好,欢迎来到化拓教育网。
搜索
您的当前位置:首页杭电oj-1000(A+B Problem)

杭电oj-1000(A+B Problem)

来源:化拓教育网

Problem Description

alculate  A + B.

Input

Each line will contain two integers A and B. Process to end
of file.

Output

For each case, output A + B in one line.

Sample Input

1 1

Sample Output

2

Author

HDOJ

简述一下哈,最近真是无聊,真是没事干,所以打算每天抽出几个小时来做做题,正直七夕哈,祝大家有情人终成眷属,表白的都成功,我打算敲一天代码,new一天对象,😄O(∩_∩)O哈哈~

当然这是最简单的一道题啦,所以我就不说思路咯,说一下用java A题的应该注意的事项:

1.必须要导包,千万不能忘记了

2.类名必须为Main

3.要注意输入、输出的格式

代码:


import java.util.Scanner;

public class Main1000 {
    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);
        }
    }
}


Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务