Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<map>
- #include<list>
- //słownik polsko-angielski,angielsko-pl
- using namespace std;
- int main() {
- map <string,string> a;
- string bufor;
- a["szczur"]="rat";
- a["mysz"]="mouse";
- cin>>bufor;
- int flaga=0;
- for(map<string,string>::iterator i=a.begin(); i!=a.end(); i++){
- //cout<< i->first <<" "<< i->second << endl;
- if(i->first==bufor){
- cout<<i->second<<endl;
- flaga=1;
- }
- if(i->second==bufor) {
- cout<<i->first<<endl;
- flaga=1;
- }
- }
- if (flaga==0) cout<<"Brak podanego hasla w slowniku"<<endl;
- list<string> b;
- b.push_back("a3");
- b.push_back("a1");
- //b.sort();
- for (list<string>::iterator i = b.begin(); i != b.end(); ++i){
- cout << *i << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement