每日一练ACM

2019.04.15

 

第1000题:A+B Problem 

Problem Description
Calculate 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

 

解:

package Acm;

import java.util.Scanner;

public class Test2 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner input=new Scanner(System.in);
        
        while(input.hasNext()){
            int a=input.nextInt();
            int b=input.nextInt();
            System.out.println(a+b);
        }
    }

}

 

 

推荐 网站: 

https://wenku.baidu.com/view/60331eae02d276a200292e2a.html

 

posted @ 2019-04-15 09:47  Hunter·Zhang  阅读(128)  评论(0编辑  收藏  举报