Balance chemical equations!
C, 442 505 chars

// element use table, then once parsed reused as molecule weights
u,t[99];

// molecules
char*s,*m[99]; // name and following separator
c,v[99][99]; // count-1, element vector

i,j,n;

// brute force solver, n==0 upon solution - assume at most 30 of each molecule
b(k){
    if(k&lt;0)for(n=j=0;!n&amp;&amp;j&lt;u;j++)for(i=0;i&lt;=c;i++)n+=t[i]*v[i][j]; // check if sums to zero
    else for(t[k]=0;n&amp;&amp;t[k]++&lt;30;)b(k-1); // loop through all combos of weights
}

main(int r,char**a){
    // parse
    for(s=m[0]=a[1];*s;){
        // parse separator, advance next molecule
        if(*s==45)r=0,s++;
        if(*s&lt;65)m[++c]=++s;
        // parse element
        j=*s++;
        if(*s&gt;96)j=*s+++j&lt;&lt;8;            
        // lookup element index
        for(i=0,t[u]=j;t[i]-j;i++);
        u+=i==u;
        // parse amount
        for(n=0;*s&gt;&gt;4==3;)n=n*10+*s++-48;
        n+=!n;
        // store element count in molecule vector, flip sign for other side of '-&gt;'
        v[c][i]=r?n:-n;
    }
    // solve
    b(c);
    // output
    for(i=0,s=n?"Nope!":a[1];*s;putchar(*s++))s==m[i]&amp;&amp;t[i++]&gt;1?printf("%d",t[i-1]):0;
    putchar(10);
}


Run as:

./a.out "C7H16+O2-&gt;CO2+H2O"
./a.out "Al+Fe2O4-&gt;Fe+Al2O3"
./a.out "Pb-&gt;Au"


Results:

C7H16+11O2-&gt;7CO2+8H2O
8Al+3Fe2O4-&gt;6Fe+4Al2O3
Nope!