Johnny was asked by his math teacher to compute nn (n to the power of
n, where n is an integer), and has to read his answer out loud. This
is a bit of a tiring task, since the result is probably an extremely
large number, and would certainly keep Johnny occupied for a while if
he were to do it honestly. But Johnny knows that the teacher will
certainly get bored when listening to his answer, and will sleep
through most of it! So, Johnny feels he will get away with reading
only the first k digits of the result before the teacher falls asleep,
and then the last k digits when the teacher wakes up.
Write a program to help Johnny to compute the digits he will need to
read
n range is 10 raise to power 9
k is always smaller than no of digits of n raise to power n

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to