# 官方题解|欢乐赛#39 T2
2025-01-22 16:42:43
发布于:浙江
9阅读
0回复
0点赞
T2
直接for循环模拟,如果是采用的pow
,记得要强制转化为整数类型哦,pow
默认是浮点数的。
#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int a[N], n, m, k;
int main(){
int x; cin >> x;
int ans = 1;
for(int i = 1; i <= x; i ++ ) ans *= 2;
cout << ans;
return 0;
}
这里空空如也
有帮助,赞一个