Can anyone give me a solution for this?
the program should output how can the chemical equation be balanced (which are the coefficients)
28th ACM International Collegiate Programming Contest, 2003-2004 Asia Region, Tehran Site
Balanced Chemical Equations
Sample Input
3
HCl+CaO2H2=CaCl2+H2O
HCl+H2SO4=NaCl
HCl+NaOH=NaCl+H2O
Sample Output
2 1 1 2
IMPOSSIBLE
1 1 1 1

A bit of a tall order. An application like this (written from scratch) would take a lot of work. First, it would have to be able to recognize individual elements symbolically, then it would have to iterate through solutions and reduce. Why not take a whack at it yourself and then post if you get stuck?

I agree with TeejMonster!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.