#include #include #include #include #include #include using namespace std; int main() { vector v(10); cout << v.size() << endl; cout << v.capacity() << endl; v.push_back(1); v.push_back(2); cout << v.size() << endl; cout << v.capacity() << endl; v.resize(20); cout << v.size() << endl; cout << v.capacity() << endl; for (unsigned i = 0; i < v.size(); i++) v[i] = i * i; for (unsigned i = 0; i < v.size(); i++) cout << v[i] << endl; v.reserve(1000); cout << v.size() << endl; cout << v.capacity() << endl; for (int i : v) cout << i << endl; for (vector::iterator i = v.begin(); i != v.end(); i++) cout << *i << endl; for (auto i = v.rbegin(); i != v.rend(); i++) cout << *i << endl; list l; cout << l.size() << endl; l.push_back(1); l.push_back(2); l.push_front(4); cout << l.size() << endl; for(auto i = l.begin(); i != l.end(); i++) cout << *i << endl; set s1; cout << s1.size() << endl; s1.insert(3); s1.insert(2); s1.insert(1); s1.insert(1); cout << s1.size() << endl; for(auto i = s1.begin(); i != s1.end(); i++) cout << *i << endl; cout << s1.count(1) << endl; cout << s1.count(11) << endl; map ocene; cout << ocene.size() << endl; ocene["marko"] = 9; ocene["mika"] = 7; cout << ocene.size() << endl; cout << ocene["marko"] << endl; map::iterator f = ocene.find("mika"); if (f != ocene.end()) cout << f->second << endl; else cout << "Ne postoji taj podatak u mapi" << endl; for (map::iterator i = ocene.begin(); i != ocene.end(); i++) cout << i->first << " - " << i->second << endl; string str = "nesto"; cout << str.size() << endl; str[1] = 'x'; cout << str << endl; return 0; }