# 题目

A+B Problem——HDU-1000

题解

Input
每行包括两个整数A和B,处理到文件结束
Output
对于每个数据,在一行输出A+B

思路

这里的输入可能有多行数据,因此使用while循环输入同时判断是否到文件结尾。

代码实现

#include<stdio.h>
int main()
{
	int A, B;
	while (scanf("%d%d",&A,&B) != EOF)
		printf("%d\n", A + B);
	return 0;
}

完成

A+B Problem——HDU-1000

相关文章: