Files
python/LuoGu/RuMen/P2415.cpp

19 lines
446 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include<bits/stdc++.h>
using namespace std;
int a[31], i = 0, j;
long long s = 0;
int main() {
//录入进来,终止条件是CTRL+D,最起码在CLion里是这样的
while (cin >> a[i++]);
//一次性和
for (j = 0; j < i; j++) {
s += a[j];
}
//规律~
s *= pow(2, i - 2);//注意,i-2! 之所有是i-2,是因为你已经使用过一次,本来是i-1
cout << s;
return 0;
}