Can anyone help me with 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
Well what are you given? I need a more specific description of the problem and what you are trying to solve before I can provide specific advice. Do you need to write the program in a specific language? I would think you would want to create a variable for each element in the equation. Then you will most likely need to figure out if the elements are on the left or right side of the equal sign. Following this you will need to determine which of the elements need to be balanced on the right side of the equation and multiply by an appropriate coefficient to balance these elements.
Well you can see what is given in input and i want it in c++, c, pascal or Java. And where can i find those scripts free on the market
but maybe someone had the official solutions of 28th ACM International Collegiate Programming Contest, 2003-2004 Asia Region, Tehran Site and is not for homework, it's just for fun