*1037计算2的幂

 1 #include<cstdio>
 2 #include<cmath>
 3 using namespace std;
 4 int main()
 5 {
 6     int n;
 7     double s;
 8     scanf("%d",&n);
 9     s=pow(2,n);
10     printf("%d",int(s));
11 
12     return 0;
13 }

注意2个问题:

1.pow()函数的使用和返回值
2.计算结果是否会超出数据范围
原文地址:https://www.cnblogs.com/tflsnoi/p/7966333.html