fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. void misteri(vector<int>& v, int a) {
  6. for (int i = 0; i < v.size(); i++) {
  7. v[i] *= a;
  8. }
  9. }
  10.  
  11. int main() {
  12. vector<int> v = {1, 2, 3};
  13. misteri(v, 10);
  14.  
  15. int total = 0;
  16. for (int x : v) {
  17. total += x;
  18. }
  19. cout << total << endl;
  20. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
60