Advertisement
MatveyL

123

Feb 21st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <queue>
  4. #include <math.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9.  
  10. int main () {
  11. int a,b;
  12. vector<int>A;
  13. vector<int>B = {0};
  14.  
  15. cin>>a;
  16.  
  17. for(int i = 0; i < a ; i ++){
  18. cin>>b;
  19. A.push_back(b);
  20. }
  21.  
  22.  
  23. for(int i = 0; i < a; i ++){
  24. B.push_back(B[i]+ A[i]);
  25.  
  26. }
  27. for(int i = 1; i < a +1; i ++){
  28. cout<<B[i]<<" ";
  29. }
  30.  
  31. cout<<endl;
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement