Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <map>
- #include <set>
- #include <vector>
- #include <string>
- #include <cstdlib>
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main(){
- map<string,int> indeksy;
- indeksy["Kowalski"] = 151206;
- indeksy["Nowak"] = 161213;
- indeksy["Wisniewski"] = 211213;
- indeksy.insert(pair<string,int>("Zielinski", 13131313));
- cout << indeksy["Nowak"] << endl;
- auto it = indeksy.find("Nowak");
- if(it != indeksy.end()) cout << it->first << " " << it->second << endl;
- cout<<indeksy["Piotrowski"]<<endl;
- auto it2 = indeksy.find("Piotrowski");
- if(it2 != indeksy.end()) cout << it2->first << " " << it2->second << endl;
- else cout << "Nie znalazl" << endl;
- cout << "\n\n" << endl;
- for(auto t : indeksy){
- cout << t.first << " " << t.second << endl;
- }
- cout << "\n\n" << endl;
- set<int> tab;
- tab.insert(1);
- tab.insert(13);
- tab.insert(15);
- tab.insert(18);
- tab.insert(19);
- tab.insert(99999999);
- for(auto t : tab){
- cout << t << endl;
- }
- cout << "\n\n" << endl;
- vector<int> tab2;
- tab2.push_back(99999999);
- tab2.push_back(1);
- tab2.push_back(18);
- tab2.push_back(13);
- tab2.push_back(15);
- tab2.push_back(19);
- sort(tab2.begin(), tab2.end());
- for(auto t : tab2){
- cout << t << endl;
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement