This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#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;