learn operator
This commit is contained in:
parent
488533bde7
commit
40f06be8bc
2
.gitignore
vendored
2
.gitignore
vendored
@ -36,3 +36,5 @@
|
||||
|
||||
tempCodeRunnerFile
|
||||
tempCodeRunnerFile.cpp
|
||||
day3/afternoon/test
|
||||
day3/afternoon/operator
|
||||
|
17
day3/afternoon/operator.cpp
Normal file
17
day3/afternoon/operator.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user