1 double p(int m,int n) 2 { 3 double a,b; 4 if(n==1) return (double)m; 5 else b=p(m,n/2); 6 a=b*b; 7 if(n%2==1) 8 a=a*m; 9 return a; 10 }