Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BoauthCPP
//g++ 7.4.0 //BoauthCPP //this code is created by Rezaul Hoque on October 26,2021;contact: jewelmrh@yahoo.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <iostream> #include <map> #include <string> int main () { std::map<std::string,std::string,std::less<std::string>> b; b["Sonar Kella"]= "Satyajit Ray"; b["Kim"]="Rudyard Kipling"; b["Michael Strogoff"]="Jules Verne"; auto f=b.find("The Jungle Book"); if(f!=b.end()){ std::cout<<"Yes,we have "<<f->first<<",written by"<<f->second<<"\n";} else { std::cout<<"Sorry, it doesn’t exist\n";} std::cout<<"Here is complete list\n"; for(auto& x: b) std::cout<<x.first<<" by "<<x.second<<"\n"; b.erase("Kim"); b.emplace("The Jungle Book", "Rudyard Kipling"); std::cout<<"Now we have "<<b.size()<<" books in our atock.\n"; std::cout<<"They are :\n"; for(auto& x: b) std::cout<<x.first<<" by "<<x.second<<"\n"; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
MyString
Korelacja Pearsona lol
integer division
Dar
Handling new types without using RTTI
simple serialization
Addition of two matrix **Part 2
ProPriceTemp
Dar
AVL - ith element
Please log in to post a comment.