39. Power of a Number
Core1000 ms256 MBSolved by 0%
Read two integers a and b and print a raised to the power b.
By definition anything raised to the power 0 is 1.
Constraints - `-100 ≤ a ≤ 100` - `0 ≤ b ≤ 9`
Input
A single line containing two integers, separated by a space.
Output
Print one integer, a raised to the power b.
Input2 5
Output32
Noteis a small power
Input5 0
Output1
Notehas an exponent of zero, so the loop never runs and the answer is 1
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.