繁尘、离梦
本帖最后由

本帖最后由 繁尘、离梦 于 2013-4-25 09:25 编辑

这里是2楼,编辑中……

今天题目就是你了,题目君

[fold]

001鸡兔同笼

Description(这里是介绍)

鸡和兔关在一个笼子里,鸡有2只脚,兔有4只脚,没有例外。已知现在可以看到笼子里m个头和n只脚,求鸡和兔子各有多少只?

Input(这个是输入的意思)

输入两个整数m和n,分别代表笼子里头的个数和脚的个数。(假设m和n都在合法的数据范围内)

Output(这个是输出的意思)

依次输出鸡和兔的只数。(数字为0的也要输出)

Sample Input(示例输入)12 40

Sample Output(示例输出)4 8

[/fold]

接下来,一口首,来吧,来到复杂点的加法题

[fold]

题目大意:非常简单,计算两个小于一千位数的整数的和,要求输入A,B后,输出结果

002 A + B Problem II

Problem Description
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.

Input
The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, each line consists of two positive integers, A and B. Notice that the integers are very large, that means you should not process them by using 32-bit integer. You may assume the length of each integer will not exceed 1000.

Output
For each test case, you should output two lines. The first line is "Case #:", # means the number of the test case. The second line is the an equation "A + B = Sum", Sum means the result of A + B. Note there are some spaces int the equation. Output a blank line between two test cases.

Sample Input(第一个数字是一共有几组数据要计算,2代表要又两组要计算)
2

1 2

112233445566778899 998877665544332211

Sample Output
Case 1:1 + 2 = 3

Case 2:112233445566778899 + 998877665544332211 = 1111111111111111110

[/fold]

003新Joseph问题

原始的Joseph问题的描述如下:有n个人围坐在一个圆桌周围,把这n个人依次编号为1,….,n.。从编号是1的人开始报数,数到第m个人出列,然后从出列的下一个人从新开始报数,数到第m个人又出列,……,如此反复直到所有的人全部出列为止。比如当n=6,m=5的时候,出列的顺序依次是5,4,6,2,3,1。 现在的问题是:假设有k个好人和k个坏人。好人的编号是1到k,坏人的编号是k+1到2k。我们希望求出m的最小值,使得最先出列的k个人都是坏人。Input仅有的一个数字是k( 0 < k < 14 )。Output使得最先出列的k个人都是坏人的m的最小值。

Sample Input

4

Sample Output

30