fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, k=0, S=0, p=10;
  6. cin>>n;
  7. int a[n];
  8. for(int i=0; i<n; i++){
  9. cin>>a[i];
  10. p*=a[i];
  11. S+=p;
  12. }
  13.  
  14. cout<<S<<" "<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5280KB
stdin
10
6 5 7 7 8 9 5 10 9 10
stdout
1003517864