DEV/DEV3.2/TP7/Prefixe/Main.java

25 lines
566 B
Java
Raw Normal View History

2023-11-29 17:27:03 +01:00
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();
2024-11-27 11:35:15 +01:00
System.out.print("\n");
2023-11-29 17:27:03 +01:00
}
}