- C++
基于满二叉树的求2的n次幂的方法
- 2024-10-11 9:50:43 @
#include<stdio.h>
unsigned long long pow(int x){
if(x == 0){
return 1;
}
return pow(x - 1) + pow(x - 1);
}
int main()
{
int n;
scanf("%d",&n);
if(n <= 0){
printf("1");
return 0;
}
printf("%lld",pow(n));
return 0;
}
我就不逼逼啥理论了 无聊发个讨论而已
0 comments
No comments so far...