Playground
//koristi C++11 - http://mendo.mk/Lecture.do?id=26 #include <iostream> #include <map> #include <string> using namespace std; int main() { map<int, string> names; names[0] = "Darko"; names[1] = "Bojan"; names[2] = "Elena"; for(pair<int, string> value : names) { cout << value.first << ": " << value.second << endl; } //0: Darko //1: Bojan //2: Elena return 0; }
Input data
Program output
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!