25 lines
566 B
Java
25 lines
566 B
Java
import java.util.*;
|
|
|
|
public class Main {
|
|
|
|
protected static ArrayDeque<String> pile;
|
|
|
|
public static void main(String[] args) {
|
|
Main.pile = new ArrayDeque(args.length);
|
|
|
|
for (int i=0; i<args.length; i++){
|
|
Main.pile.push(args[i]);
|
|
}
|
|
|
|
Noeud noeudDeb;
|
|
String debutArbre = Main.pile.pop();
|
|
if (debutArbre.equals("+")||debutArbre.equals("-")||debutArbre.equals("x")||debutArbre.equals("/")){
|
|
noeudDeb = new NoeudOperation(debutArbre);
|
|
}
|
|
else{
|
|
noeudDeb = new NoeudChiffre(debutArbre);
|
|
}
|
|
noeudDeb.afficherNoeud();
|
|
System.out.print("\n");
|
|
}
|
|
} |