int get_power(int a, int b)
{
if(!b)
return 1;
if(b%2)
 return a * get_power(a, b/2);
 return get_power(a, b/2);
 }

int func(int p)
{ int sum = 0;
 for(int i = 1; i <= p; ++i)
{
sum += get_power(i, 5);
}
return sum;

}

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

Reply via email to