HDOJ 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
 
 
Code:
 1 #include <stdio.h>
2 main()
3 {
4 int A,B;
5
6 while(scanf("%d%d",&A,&B)!=EOF)
7 {
8 printf("%d\n",A+B);
9 }
10 }
Tips:
    Process to end of file.  //使用while循环,终止于EOF。
    output A + B in one line.  //printf需输出"/n"。

posted @ 2012-02-23 00:43  任琦磊  阅读(675)  评论(0编辑  收藏  举报