Skip to content

Commit

Permalink
Created maps.cpp as per abhishekdoifode1#701
Browse files Browse the repository at this point in the history
  • Loading branch information
shreya-jpg authored Oct 3, 2021
1 parent f828e26 commit c2d2106
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cpp-programs/maps.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
map<string, int> marksMap;
marksMap["Harry"] = 98;
marksMap["Jack"] = 59;
marksMap["Rohan"] = 2;
map<string, int> :: iterator iter;
for (iter = marksMap.begin() ; iter != marksMap.end(); iter++)
{
cout<<(*iter).first<<" "<<(*iter).second<<endl;
}

}

0 comments on commit c2d2106

Please sign in to comment.