Solution to Power from Jobdu

5 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1514 Question Name: Power Question Description: Give a double and an integer, without using the math library, compute the base to the power of exponent. Input: may contains multiple test cases. The first line indicates how many … Read More »

Solution to Simulate Stack With Two Queues

2 Aug

Question Name: Simulate Stack With Two Queues

Solution to Fibonacci from Jobdu

1 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1387 Question Name: Fibonacci Question Description: find the Fibonacci number F(N). Input: may contains multiple test cases. Each case is a single line, including one integer as the N. Output: the Fibonacci number F(N).

The solution … Read More »

Solution to Expand Spaces from Jobdu

30 Jul

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1510 Question Name: Expand Spaces Question Description: giving a string, expand all spaces into “%20”. Input: a single line as the original string. Output: the expanded string. Example:

It is completely the same as the problem … Read More »