#include <iostream>
using namespace std;
double f(double x, int n);
int main(){
cout<<f(3, 6)<<endl;
return 0;
}
double f(double x, int n){
double res = 1;
while (n != 0) {
if(n & 1) res *= x;
x *= x;
n = n >> 1;
}
return res;
}
网友评论