Josif_tepe

Untitled

Aug 29th, 2025
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 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.    
  14.     for(pair<string, int> p: oceni) {
  15.         cout << p.first << " " << p.second << endl;
  16.     }
  17.    
  18.     for(map<string, int>::iterator it = oceni.begin(); it != oceni.end(); it++) {
  19.         cout << it->first << " " << it->second << endl;
  20.     }
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment