Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- #include <iomanip>
- using namespace std;
- void Print(const vector <int>& v, const string& title)
- {
- cout << title << ": ";
- for (auto i : v)
- {
- cout << i << ' ';
- }
- }
- int main()
- {
- string s1 = "abc";
- string s2 = "bca";
- cout << min(s1, s2) << endl;
- cout << max(s1, s2) << endl;
- cout << min(2, 3) << endl;
- cout << max(2, 3) << endl;
- vector<int> v = { 1,3,5,2,4 };
- Print(v, "init");
- sort(begin(v), end(v));
- cout << endl;
- Print(v, "sort");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement