Input
Your program is to read from standard input. The input consists of T test cases. The number of test cases T is given in the first line of the input. Each test case is given in a single line, which contains a molecular formula as a string. The chemical symbol is given by a capital letter and the length of the string is greater than 0 and less than 80. The quantity number n which is represented after the chemical symbol would be omitted when the number is 1 (2n99) .
Output
Your program is to write to standard output. Print exactly one line for each test case. The line should contain the molar mass of the given molecular formula.
Sample Input
4 C C6H5OH NH2CH2COOH C12H22O11
Sample Output
12.010 94.108 75.070 342.296#include
#include
#include
#include
using namespace std;
int main()
{int i,n,k,m,d,f;
double s;
char a[105][90];
while(cin>>n)
{ memset(a,0,sizeof(a));
for(i=0;i>a;
for(i=0;i |