-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMap.cpp
More file actions
27 lines (24 loc) · 722 Bytes
/
Copy pathMap.cpp
File metadata and controls
27 lines (24 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<iostream>
#include<map>
#include<string>
using namespace std;
int main()
{
map<string , int> marksMap;
marksMap["Sayak"] = 96;
marksMap["Bitan"] = 99;
marksMap["Monkey"] = 88;
marksMap["Bonzo"] =59;
map<string , int> :: iterator iter;
for(iter = marksMap.begin() ; iter!= marksMap.end() ; iter++)
{
cout<<(*iter).first <<" " <<(*iter).second<<"\n";//we get output in sorted manner of alphabets
}
marksMap.insert({{"Sayan",55},{"Atul" , 98}});
cout<<endl;
for(iter = marksMap.begin() ; iter!= marksMap.end() ; iter++)
{
cout<<(*iter).first <<" " <<(*iter).second<<"\n";//we get output in sorted manner of alphabets
}
return 0;
}