Created
April 16, 2016 16:14
-
-
Save tanvir002700/a0341b750cd7ef07acca45af4c372b5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<map> | |
using namespace std; | |
int main() | |
{ | |
map<char,int>Map; | |
for(char c='a';c<='j';c++) | |
{ | |
int value=(int)c; | |
Map[c]=value; | |
} | |
for(char c='a';c<='z';c++) | |
{ | |
if(Map[c]==0)cout<<"key "<<c<<" not found"<<endl; | |
else cout<<"key "<<c<<" found"<<endl; | |
} | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<map> | |
using namespace std; | |
int main() | |
{ | |
map<char,int>Map; | |
for(char c='a';c<='j';c++) | |
{ | |
int value=(int)c; | |
Map[c]=value; | |
} | |
for(char c='a';c<='z';c++) | |
{ | |
if(Map.find(c)!=Map.end())cout<<"Key "<<c<<" found"<<endl; | |
else cout<<"Key "<<c<<" not found"<<endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment