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題的應(yīng)該注意的事項:
1.必須要導(dǎo)包,千萬不能忘記了
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);
}
}
}