#include<bits/stdc++.h>
using namespace std;
int main(){
int a;
while(cin>>a){
int sum=0;
for(int i=1;i<=a;i++){
int b;
cin>>b;
sum+=b*i;
}
cout<<sum<<endl;
}
}
第一句的意義
https://stackoverflow.com/questions/25311011/how-does-include-bits-stdc-h-work-in-c