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 test cases are there in the following input. Each of the next lines contains a double and then an integer (separated with a space).

Output: the power result for each test case.

I used half hour to solve the power, and then two hours for the output issue. If anyone know why, please do leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!