课评: 转出学生归档(王子墨/张立坤/黄俊博)+ 周四班级总结 + 新生章梓皓档案 + C++示例代码
This commit is contained in:
19
C++代码/GESP考级/一级/202609棋盘上的奖赏.cpp
Normal file
19
C++代码/GESP考级/一级/202609棋盘上的奖赏.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <bits/stdc++.h>
|
||||
#define endl '\n'
|
||||
using namespace std;
|
||||
|
||||
int n;
|
||||
int arr[100100];
|
||||
|
||||
int main(){
|
||||
cin >> n;
|
||||
long long cnt = 1;
|
||||
|
||||
for(int i = 1; i <= n; i++){
|
||||
cnt = cnt * 2;
|
||||
}
|
||||
|
||||
cout << cnt - 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user