SHOW:
|
|
- or go back to the newest paste.
1 | #include <iostream> | |
2 | #include <string> | |
3 | #include <map> | |
4 | ||
5 | using namespace std; | |
6 | ||
7 | map<string, string> gettable(); | |
8 | ||
9 | int main() | |
10 | { | |
11 | map<string, string> periodictable = gettable(); | |
12 | string input(""); | |
13 | getline(cin,input); | |
14 | ||
15 | for(auto p : periodictable) | |
16 | { | |
17 | string temp = input; | |
18 | if(temp.find(p.first) != string::npos) | |
19 | { | |
20 | temp.replace(temp.find(p.first),p.first.size(),p.second); | |
21 | cout << temp << endl; | |
22 | } | |
23 | ||
24 | } | |
25 | system("PAUSE"); | |
26 | return 0; | |
27 | } | |
28 | ||
29 | map<string, string> gettable() | |
30 | { | |
31 | map<string, string> elements{ | |
32 | {"h","[H]"}, {"he","[He]"}, {"li","[Li]"}, {"be","[Be]"}, {"b","[B]"}, {"c","[C]"}, {"n","[N]"}, | |
33 | {"o","[O]"}, {"f","[F]"}, {"ne","[Ne]"}, {"na","[Na]"}, {"mg","[Mg]"}, {"al","[Al]"}, {"si","[Si]"}, | |
34 | {"p","[P]"}, {"s","[S]"}, {"cl","[Cl]"}, {"ar","[Ar]"}, {"k","[K]"}, {"ca","[Ca]"}, {"sc","[Sc]"}, | |
35 | {"ti","[Ti]"}, {"v","[V]"}, {"cr","[Cr]"}, {"mn","[Mn]"}, {"fe","[Fe]"}, {"co","[Co]"}, {"ni","[Ni]"}, | |
36 | {"cu","[Cu]"}, {"zn","[Zn]"}, {"ga","[Ga]"}, {"ge","[Ge]"}, {"as","[As]"}, {"se","[Se]"}, {"br","[Br]"}, | |
37 | {"kr","[Kr]"}, {"rb","[Rb]"}, {"sr","[Sr]"}, {"y","[Y]"}, {"zr","[Zr]"}, {"nb","[Nb]"}, {"mo","[Mo]"}, | |
38 | {"tc","[Tc]"}, {"ru","[Ru]"}, {"rh","[Rh]"}, {"pd","[Pd]"}, {"ag","[Ag]"}, {"cd","[Cd]"}, {"ub","[In]"}, | |
39 | {"sn","[Sn]"}, {"sb","[Sb]"}, {"te","[Te]"}, {"i","[I]"}, {"xe","[Xe]"}, {"cs","[Cs]"}, {"ba","[Ba]"}, | |
40 | {"hf","[Hf]"}, {"ta","[Ta]"}, {"w","[W]"}, {"re","[Re]"}, {"os","[Os]"}, {"ir","[Ir]"}, {"pt","[Pt]"}, | |
41 | {"au","[Au]"}, {"hg","[Hg]"}, {"ti","[Ti]"}, {"pb","[Pb]"}, {"bi","[Bi]"}, {"po","[Po]"}, {"at","[At]"}, | |
42 | - | {"rn","[Rn]"}, {"fr","[Fr]"}, {"ra","[Ra]"}, {"rf"] = "[Rf]"}, {"db"] = "[Db]"}, {"sg"] = "[Sg]"}, {"bh"] = "[Bh]"}, |
42 | + | {"rn","[Rn]"}, {"fr","[Fr]"}, {"ra","[Ra]"}, {"rf"] , "[Rf]"}, {"db"] , "[Db]"}, {"sg"] , "[Sg]"}, {"bh"] , "[Bh]"}, |
43 | - | {"hs"] = "[Hs]"}, {"mt"] = "[Mt]"}, {"ds"] = "[Ds]"}, {"rg"] = "[Rg]"}, {"cn"] = "[Cn]"}, {"uut"] = "[Uut]"}, |
43 | + | {"hs"] , "[Hs]"}, {"mt"] , "[Mt]"}, {"ds"] , "[Ds]"}, {"rg"] , "[Rg]"}, {"cn"] , "[Cn]"}, {"uut"] , "[Uut]"}, |
44 | - | {"fl"] = "[Fl]"}, {"uup"] = "[Uup]"}, {"lv"] = "[Lv]"}, {"uus"] = "[Uus]"}, {"uuo"] = "[Uuo]"}, {"rf"] = "[Rf]"} |
44 | + | {"fl"] , "[Fl]"}, {"uup"] , "[Uup]"}, {"lv"] , "[Lv]"}, {"uus"] , "[Uus]"}, {"uuo"] , "[Uuo]"}, {"rf"] , "[Rf]"} |
45 | }; | |
46 | ||
47 | ||
48 | return elements; | |
49 | ||
50 | ||
51 | } |