Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. ostream& operator<<(ostream& cout, vector<int>& myVector) {
  8.     cout << '(';
  9.     for (int i = 0; i < myVector.size(); ++i) {
  10.         cout << myVector[i] << ' ';
  11.     }
  12.     cout << ')';
  13.     return cout;
  14. }
  15.  
  16. int main() {
  17.     vector<int> myVector = {1, 2, 3, 4, 5};
  18.     cout << myVector << ' ' << "hello";
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement