Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- using namespace std;
- int main() {
- map<string, int> oceni;
- oceni["Josif"] = 3;
- oceni["Kiril"] = 4;
- oceni["Petar"] = 5;
- oceni.insert({"Pero", 1});
- oceni.insert({"Riste", 2});
- map<string, int>::iterator it = oceni.find("Kire");
- if(it != oceni.end()) {
- cout << it->first << " " << it->second << endl;
- }
- else {
- cout << "Ovoj kluc ne postoi" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment