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
簡述一下哈,最近真是無聊荸频,真是沒事干,所以打算每天抽出幾個(gè)小時(shí)來做做題,正直七夕哈卢厂,祝大家有情人終成眷屬,表白的都成功惠啄,我打算敲一天代碼慎恒,new一天對(duì)象,??O(∩_∩)O哈哈~
當(dāng)然這是最簡單的一道題啦撵渡,所以我就不說思路咯融柬,說一下用java A題的應(yīng)該注意的事項(xià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);
}
}
}