"; for ($i=1; $i<=118; $i++) {if($E1==$S[$i]){$c1=1;}} if($c1!=1){print"E1 erróneo";exit();} for ($i=1; $i<=117; $i++) {if($E2==$S[$i]){$c2=1;}} if($c2!=1){print"E2 erróneo";exit();} for ($i=1; $i<=117; $i++) {if($E3==$S[$i]){$c3=1;}} if($c3!=1){print"E3 erróneo";exit();} if($OH=="OH" and $E2!= "O"){print "E2 erróneo"; exit();} if($OH=="OH" and $E3!= "H"){print "E3 erróneo"; exit();} if($OH=="OH" and $N2!= -2){print "z erróneo"; exit();} if($OH=="OH" and $N3!= 1){print "y erróneo"; exit();} if($OH=="OH"){ if($N1==1){print $E1."OH" ;exit();} else{print $E1."(OH)".$N1."" ;exit();} } $R1=$N2%2; if($R1!=0) {$NO =($N2+1)/2;} ; if($R1==0) {$NO =($N2+2)/2;} ; $NE1=(-1*$N2)-($NO*$N3); $RT1=$NE1%$N1; $RT2=$N1%$NE1; if($RT1==0 or $RT2==0) {if($NE1>=$N1){$NE1=$NE1/$N1;$N1=1;}} if($RT1==0 or $RT2==0) {if($N1>=$NE1){$N1=$N1/$NE1;$NE1=1;}} if($NE1==1){$NE1="";} if($NO==1){$NO="";} if($NE1=="" and $E1=="NH4") { print"NH4".$E2.$E3."".$NO."";exit();} if($E1=="NH4"){ print "(NH4)".$NE1."".$E2.$E3."".$NO."";exit();} if($N1==1){$N1=""; print $E1."".$NE1."".$E2.$E3."".$NO."";exit();}; if($N1==$NE1){ print $E1.$E2.$E3."".$NO."";exit();}; print $E1."".$NE1.""."(".$E2.$E3."".$NO."".")"."".$N1.""; } ?> |