9 short symbol
; // two char bytes
10 char name
[100]="Ununenium";
16 inline void s(string _
,string a
,double b
){element c
;strcpy(c
.name
,a
.c_str());c
.n
=e
.size()+1;c
.symbol
=_
.length()==1?(_
[0]):((_
[0]<<8)|(_
[1]));c
.mass
=b
;} // quick element add
17 inline bool equal_symbol(short a
, short b
){return (((a
/0x100)==(b
/0x100))||((a
/0x100)-'A'+'a'==(b
/0x100))||((a
/0x100)-'a'+'A'==(b
/0x100)))&&(a
%0x100==b
%0x100);}
19 int main(int argc
, const char** argv
)
21 s("H","Hydrogen",1.0080);
22 s("He","Helium",4.0026);
23 s("Li","Lithium",6.94);
24 s("Be","Beryllium",9.0122);
26 s("C","Carbon",12.011);
27 s("N","Nitrogen",14.007);
28 s("O","Oxygen",15.999);
29 s("F","Fluorine",18.998);
30 s("Ne","Neon",20.180);
31 s("Na","Sodium",22.990);
32 s("Mg","Magnesium",24.305);
142 || argv
[1]=="-"))) // read from stdin
144 cout
<<"plz input formula as parameter.\n";