BlueBook

p124ex5 - Power Base

Write a program that reads a real value X and a positive integer P and then calculates and prints the value of XP.

Input

The first line of input will be the amount of test cases N and the following N test cases. Each of the test cases will have 2 numbers on each line.

Output

All answers should be to 2 decimal places.

Sample Input

3
2.0 4
4.0 2
3.0 3

Sample Output

16.00
16.00
27.00

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 22, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

Why is my code not working??
I tried sample data. Also made my own test cases, but the judge never gives me 100%

Output
All answers should be to 2 decimal places.

Weird, but if you round to 2 decimal places, it AC's.

Output
All answers should be to 2 decimal places.

^ maybe that's why

my program works fine on eclipse and gives the correct answer every time, but the judge gives me 10/30?

Re-read the announcement -- it's been updated.
All your output is on the same line.

Ok I have the formula to find the X^P but I still get 20/30. What I am I not considering? I took "" 0^<something> "" into account; the output should be '0.00' in that case...

I don't get what am I missing? Is it that the 0.00 should be just 0 or something?


ln doesn't work for negative numbers.
There's no need for a special formula, though.