1#include <bits/stdc++.h>
2#include <iostream>
3#include <map>
4using namespace std;
5void mapDemo(){
6 map<int, int> A;
7 A[1] = 100;
8 A[2] = -1;
9 A[3] = 200;
10 A[100000232] = 1;
11 //to find the value of a key
12 //A.find(key)
13
14 //to delete the key
15 //A.erase(key)
16
17 map<char, int> cnt;
18 string x = "Sumant Tirkey";
19
20 for(char c:x){
21 cnt[c]++;//map the individual character with it's occurance_Xtimes
22 }
23
24 //see how many times a and z occures in my name
25 cout<< cnt['a']<<" "<<cnt['z']<<endl;
26
27}
28
29int main() {
30 mapDemo();
31 return 0;
32}