Files
python/TangDou/LuoGuBook/P2415.cpp

18 lines
331 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 110;
LL a[N];
int n;
LL res;
int main() {
//录入进来,终止条件是CTRL+D
while (cin >> a[++n]);
n--;
for (int i = 1; i <= n; i++)
res += a[i] * pow(2, n - 1);
cout << res << endl;
return 0;
}