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
题解:题意很简单,输入两个数字,求两个数字之和。是不是很简单?不是的,这样肯定会出现wrong answer, 这里只给出一组案例,是个陷阱,其实他要求输入多组案例,所以要加入循环语句。
#include<stdio.h> int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) printf("%d ",a+b); return 0; }