A + B ProblemTime 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
Sample Output
Author
HDOJ
|
分析:注意要连续输入,scanf函数是有返回值的,EOF在运行过程中是按control+z退出的
代码:
#include<stdio.h> int main() { int m,n; while(scanf("%d%d",&m,&n)!=EOF) { printf("%d\n",m+n); } return 0; }