scanf 函数的返回值反映的是按照指定的格式符正确读入的数据的个数
例子:
1001 - A+B
Problem Description
for each pair of integers A and B ( 0 <= A,B <= 10) , Output the result of A+B on a single line.
#include <stdio.h>
using namespace std;
int main()
{
int a,b;
while(scanf("%d %d",&a,&b)==2){
printf("%d\n",a+b);
}
return 0;
}