double pow(double a, int n) { if (n == 0) { return 1.0; } double b = pow(a, n / 2); b *= b; if (n % 2 == 1) { b *= a; } return b;}