learn operator

This commit is contained in:
Zengtudor 2024-08-04 14:40:17 +08:00
parent 488533bde7
commit 40f06be8bc
2 changed files with 19 additions and 0 deletions

2
.gitignore vendored
View File

@ -36,3 +36,5 @@
tempCodeRunnerFile
tempCodeRunnerFile.cpp
day3/afternoon/test
day3/afternoon/operator

View File

@ -0,0 +1,17 @@
#include <bits/stdc++.h>
using std::cout,std::cin,std::vector,std::endl;
std::ostream& operator<<(std::ostream& os,vector<int> &v){
os<<"vector<int> [";
for(size_t i=0;i<v.size();i++){
os<<v[i]<<(i!=v.size()-1?",":"]\n");
}
return os;
}
int main(){
vector<int> v;
v.push_back(1);
v.push_back(2);
cout<<v<<endl;
}