Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- #include <sstream>
- #include <utility>
- #include <fstream>
- using namespace std;
- ************************************************************************
- template <typename T>
- ostream& operator<< (ostream& out, const vector<T>& vi)
- {
- for (const auto& i : vi)
- {
- out << i << ' ';
- }
- return out;
- }
- ************************************************************************
- template <typename First, typename Second>
- ostream& operator<< (ostream& out, const pair<First, Second>& p)
- {
- out << p.first << ',' << p.second;
- return out;
- }
- ************************************************************************
- template <typename Key, typename Value>
- ostream& operator<< (ostream& out, const map<Key, Value>& m)
- {
- for (const auto& i : m)
- {
- out << i << ' ';
- }
- return out;
- }
- ************************************************************************
- int main()
- {
- /*ifstream fin;
- ofstream of;
- fstream f;
- istringstream g;
- ostringstream h;
- stringstream s;*/
- //мои
- vector<double> vi = { 1.4,2,3 };
- cout << vi << endl;
- map<int, double> m = { {1,2.5}, {3,4} };
- cout << m << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement