首页 > ACM题库 > HDU-杭电 > HDU 1095 A+B for Input-Output Practice (VII)[解题报告] C++
2013
11-27

HDU 1095 A+B for Input-Output Practice (VII)[解题报告] C++

A+B for Input-Output Practice (VII)

问题描述 :

Your task is to Calculate a + b.

输入:

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, and followed by a blank line.

样例输入:

1 5
10 20

样例输出:

6

30
 

2011-12-12 04:55:58

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

题意:a+b。。。

代码(C编译):

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


  1. Gucci New Fall Arrivals

    This is really nice to know. I hope it will be successful in the future. Good job on this and keep up the good work.

  2. a是根先忽略掉,递归子树。剩下前缀bejkcfghid和后缀jkebfghicd,分拆的原则的是每个子树前缀和后缀的节点个数是一样的,根节点出现在前缀的第一个,后缀的最后一个。根节点b出现后缀的第四个位置,则第一部分为四个节点,前缀bejk,后缀jkeb,剩下的c出现在后缀的倒数第2个,就划分为cfghi和 fghic,第3部分就为c、c

  3. 你的理解应该是:即使主持人拿走一个箱子对结果没有影响。这样想,主持人拿走的箱子只是没有影响到你初始选择的那个箱子中有奖品的概率,但是改变了其余两个箱子的概率分布。由 1/3,1/3 变成了 0, 2/3