Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <map>
- using namespace std;
- map<string, string> gettable();
- int main()
- {
- map<string, string> periodictable = gettable();
- string input("");
- getline(cin,input);
- for(auto p : periodictable)
- {
- string temp = input;
- if(temp.find(p.first) != string::npos)
- {
- temp.replace(temp.find(p.first),p.first.size(),p.second);
- cout << temp << endl;
- }
- }
- system("PAUSE");
- return 0;
- }
- map<string, string> gettable()
- {
- map<string, string> elements{
- {"h","[H]"}, {"he","[He]"}, {"li","[Li]"}, {"be","[Be]"}, {"b","[B]"}, {"c","[C]"}, {"n","[N]"},
- {"o","[O]"}, {"f","[F]"}, {"ne","[Ne]"}, {"na","[Na]"}, {"mg","[Mg]"}, {"al","[Al]"}, {"si","[Si]"},
- {"p","[P]"}, {"s","[S]"}, {"cl","[Cl]"}, {"ar","[Ar]"}, {"k","[K]"}, {"ca","[Ca]"}, {"sc","[Sc]"},
- {"ti","[Ti]"}, {"v","[V]"}, {"cr","[Cr]"}, {"mn","[Mn]"}, {"fe","[Fe]"}, {"co","[Co]"}, {"ni","[Ni]"},
- {"cu","[Cu]"}, {"zn","[Zn]"}, {"ga","[Ga]"}, {"ge","[Ge]"}, {"as","[As]"}, {"se","[Se]"}, {"br","[Br]"},
- {"kr","[Kr]"}, {"rb","[Rb]"}, {"sr","[Sr]"}, {"y","[Y]"}, {"zr","[Zr]"}, {"nb","[Nb]"}, {"mo","[Mo]"},
- {"tc","[Tc]"}, {"ru","[Ru]"}, {"rh","[Rh]"}, {"pd","[Pd]"}, {"ag","[Ag]"}, {"cd","[Cd]"}, {"ub","[In]"},
- {"sn","[Sn]"}, {"sb","[Sb]"}, {"te","[Te]"}, {"i","[I]"}, {"xe","[Xe]"}, {"cs","[Cs]"}, {"ba","[Ba]"},
- {"hf","[Hf]"}, {"ta","[Ta]"}, {"w","[W]"}, {"re","[Re]"}, {"os","[Os]"}, {"ir","[Ir]"}, {"pt","[Pt]"},
- {"au","[Au]"}, {"hg","[Hg]"}, {"ti","[Ti]"}, {"pb","[Pb]"}, {"bi","[Bi]"}, {"po","[Po]"}, {"at","[At]"},
- {"rn","[Rn]"}, {"fr","[Fr]"}, {"ra","[Ra]"}, {"rf"] , "[Rf]"}, {"db"] , "[Db]"}, {"sg"] , "[Sg]"}, {"bh"] , "[Bh]"},
- {"hs"] , "[Hs]"}, {"mt"] , "[Mt]"}, {"ds"] , "[Ds]"}, {"rg"] , "[Rg]"}, {"cn"] , "[Cn]"}, {"uut"] , "[Uut]"},
- {"fl"] , "[Fl]"}, {"uup"] , "[Uup]"}, {"lv"] , "[Lv]"}, {"uus"] , "[Uus]"}, {"uuo"] , "[Uuo]"}, {"rf"] , "[Rf]"}
- };
- return elements;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement