Created
April 1, 2018 19:17
-
-
Save oppahero/d04330006c3365f711a48cc1fce485fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Separando elementos de la expresión | |
for (int n = 0; n < operacion.length(); n++) { | |
c = operacion.charAt(n); | |
if ( c != '(' && c != '*' && c != ' ' && c != ')' ){ //Mientras no sea un caracter especial | |
aux+=c; //Acumulamos | |
}else{ | |
if (bandera) | |
PrimeraOperacion.push(aux); | |
else{ | |
if (c == '(') | |
bandera= true; | |
else{ | |
if (a!=1) | |
SegundaOperacion.push(aux); | |
} | |
} | |
if (c == ')'){ | |
a=1; | |
bandera=false; | |
} | |
aux=""; | |
} | |
} | |
if ( c!= ')' && bandera==false){ | |
SegundaOperacion.push(aux); | |
operador = true; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment