- soil Analysis
Rover 承担了火星土壤采样分析任务,你需要写一个分析模块,来根据探测器检测到的分子式计算物质的分子质量。
元素由一个大写字母或一个大写字母加一个小写字母组成,如H(氢),C(碳),He(氦),Cu(铜)。分子式由元素名,数字,括号()[]{}组成,如H2O,CH3(CH2)16CH3,Fe3[Fe(CN)6]2。
输入每个元素的相对原子质量和要求的分子式,输出相对分子质量
H = 1.00794
C = 12.011
N = 14.00674
O = 15.9994
Fe = 55.845
H2O
CH3(CH2)16CH3
Fe3[Fe(CN)6]2
H2O = 18.015
CH3(CH2)16CH3 = 254.5
Fe3[Fe(CN)6]2 = 591.438