首页 > ACM题库 > HDU-杭电 > HDU 1089 A+B for Input-Output Practice (I)简单练习[解题报告] C++
2013
11-27

HDU 1089 A+B for Input-Output Practice (I)简单练习[解题报告] C++

A+B for Input-Output Practice (I)

问题描述 :

Your task is to Calculate a + b.
Too easy?! Of course! I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.

输入:

The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.

输出:

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.

样例输入:

1 5
10 20

样例输出:

6
30

2011-12-12 04:39:43

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1089

题意:同1000

代码(C编译):

main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);}


  1. 约瑟夫也用说这么长……很成熟的一个问题了,分治的方法解起来o(n)就可以了,有兴趣可以看看具体数学的第一章,关于约瑟夫问题推导出了一系列的结论,很漂亮