HDU 1000 A + B Problem

A + B Problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 240144    Accepted Submission(s): 70866


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
 

Author
HDOJ
 


分析:注意要连续输入,scanf函数是有返回值的,EOF在运行过程中是按control+z退出的

代码:

#include

int main()
{
    int m,n;
    while(scanf("%d%d",&m,&n)!=EOF)
    {
        printf("%d\n",m+n);
    }
    return 0;
}



你可能感兴趣的:(hdu,ACM,水题128题,output,input,each)