29 Novembre

This commit is contained in:
2023-11-29 17:27:03 +01:00
parent fae1f4c4c5
commit 9a4e1c622e
28 changed files with 355 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
public class NoeudOperation extends Noeud{
public NoeudOperation(String ope){
this.val = ope;
for(int i=0;i<2;i++){
String prochainNoeud = Main.pile.pop();
if (prochainNoeud.equals("+")||prochainNoeud.equals("-")||prochainNoeud.equals("x")||prochainNoeud.equals("/")){
this.noeudGauche = new NoeudOperation(prochainNoeud);
}
else{
this.noeudGauche = new NoeudChiffre(prochainNoeud);
}
}
}
protected void afficherNoeud(){
System.out.print(val+" ");
this.noeudGauche.afficherNoeud();
this.noeudDroit.afficherNoeud();
}
}