fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector<int> vec {7, 4, 75, 45, 75, 77, 100};
  7. for (auto &i : vec)
  8. {
  9. cout << "value: " << i << " at: " << (&i - &vec[0]) << endl;
  10. }
  11. // your code goes here
  12. return 0;
  13. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
value: 7 at: 0
value: 4 at: 1
value: 75 at: 2
value: 45 at: 3
value: 75 at: 4
value: 77 at: 5
value: 100 at: 6