#include <stdio.h> int power(a, n){ if(0 == n) return 1; int x = power(a, n/2); if(n % 2 == 0) return x * x; else return a * x * x; } int main(){ printf("%d\n", power(32, 3)); return 0; }
标签:function return printf div else print ret cpp include
#include <stdio.h> int power(a, n){ if(0 == n) return 1; int x = power(a, n/2); if(n % 2 == 0) return x * x; else return a * x * x; } int main(){ printf("%d\n", power(32, 3)); return 0; }
标签:function return printf div else print ret cpp include
原文地址:http://www.cnblogs.com/mocuishle/p/8028271.html