Josif_tepe

Untitled

Aug 29th, 2025
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6.    
  7.     map<string, int> oceni;
  8.    
  9.     oceni["Josif"] = 3;
  10.     oceni["Kiril"] = 4;
  11.     oceni["Petar"] = 5;
  12.    
  13.     oceni.insert({"Pero", 1});
  14.     oceni.insert({"Riste", 2});
  15.     oceni["Vasil"] = 2;
  16.    
  17.    
  18.     oceni.erase("Kiril");
  19.     oceni.erase(oceni.begin());
  20.    
  21.     for(map<string, int>::iterator it = oceni.begin(); it != oceni.end(); it++) {
  22.         cout << it->first << " " << it->second << endl;
  23.     }
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment