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这本是个非常简单的问题,骚就骚在end of file。看到这里当时我就慌了,难道还要用文件输入输出?这样的话,文件名是什么?无奈之下上网百度,得到如下处理方式while(scanf("%d%d",&a,&b) != EOF)其实就是把输入缓冲区的东西全读出来……什么end of file,搞事情!答案代码#include <stdio.h> int main(void) { int a,b; while(scanf("%d%d",&a,&b)!=EOF) printf("%d\n",a+b); return 0; }