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.计算结果是否会超出数据范围

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2022-03-09
  • 2022-12-23
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2021-07-19
  • 2021-06-16
  • 2021-09-25
相关资源
相似解决方案